Commit 416bae7d authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[1927] Use barrier instead of sleep

It should be more reliable to ensure all messages arrived.
parent c8b7d82c
......@@ -235,11 +235,11 @@ class MsgqRunTest(unittest.TestCase):
self.assertTrue(lname in lnames)
# Wait a short time, so messages sent where they don't belong get some
# time to arrive. They could still be late, so the test could still
# pass on a slow machine, but an unreliable test is better than none
# at all. Any idea how to do it in a better way?
# The barrier makes the msgq process everything we sent. As the
# processing is single-threaded in it, any stray message would have
# arrived before the barrier ends.
for c in conn_b:
self.assertEqual((None, None), c.group_recvmsg())
self.assertEqual((None, None), conn_a.group_recvmsg())
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment