Skip to content

Commit

Permalink
Increased wait time for test queue...
Browse files Browse the repository at this point in the history
I don't know what is going on, but I don't like it - the timeout in Queue.get() seems to never actually be fired! Also, github tests seem to sorta... fail on the timeouts
  • Loading branch information
dkumor committed Aug 28, 2019
1 parent 8d08edc commit 4519e66
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions rtcbot/base/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ def _producer(self):
while not self._shouldClose:
# In real code, there should be a timeout in get to make sure _shouldClose is not True
try:
self._put_nowait(self.testQueue.get(1))
except TimeoutError:
# WTF: why does timeout not work here?
self._put_nowait(self.testQueue.get(timeout=3))
except queue.Empty:
pass
self.testResultQueue.put("<<END>>")
self._setReady(False)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@ async def test_ThreadedProducer(self):

def pushsleep():
# Work around the lack of a timeout in testing p
time.sleep(1)
time.sleep(5)
p.testQueue.put("Ending")

threading.Thread(target=pushsleep).run()

p.close()
await asyncio.sleep(0.01)
await asyncio.sleep(0.1)

self.assertEqual(p.ready, False)

Expand Down

0 comments on commit 4519e66

Please sign in to comment.