Skip to content

Commit

Permalink
Fix an intermittent test failure
Browse files Browse the repository at this point in the history
Logging goes via an asynchronous queue, so the log message not have
reached Python by the time we check for it. For now just work around it
by adding a sleep.
  • Loading branch information
bmerry committed Mar 7, 2019
1 parent 547de15 commit 39464d0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spead2/test/test_recv.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,8 @@ def test_disallow_unsized_heaps(self):
if assert_logs is not None:
with assert_logs('spead2', 'INFO') as cm:
heaps = self.data_to_heaps(packet, allow_unsized_heaps=False)
# Logging is asynchronous, so we have to give it a bit of time
time.sleep(0.1)
assert_equal(cm.output, ['INFO:spead2:packet rejected because it has no HEAP_LEN'])
else:
# Python 2 fallback
Expand Down

0 comments on commit 39464d0

Please sign in to comment.