Commit 642b59c2 authored by Vincent Pelletier's avatar Vincent Pelletier

test: Always clear wait event in UntilEvent when it occurred.

So the instance is readily reusable and less likely to be misused.
parent 4e126969
......@@ -182,16 +182,14 @@ class UntilEvent(object):
raise ValueError # pragma: no cover
self._action = value
def wait(self, timeout=10, clear=False):
def wait(self, timeout=10):
"""
Wait for event to be waited upon at least once.
timeout (float)
Maximum number of seconds to wait for.
clear (bool)
Whether to reset this flag once reached.
"""
result = self._wait_event.wait(timeout)
if result and clear:
if result:
self._wait_event.clear()
return result
......@@ -1951,7 +1949,7 @@ class CaucaseTest(unittest.TestCase):
updater_thread.daemon = True
updater_thread.start()
try:
self.assertTrue(until_updater.wait(clear=True))
self.assertTrue(until_updater.wait())
# CSR must have been submitted
csr_line_list = self._runClient(
'--user-key', user_key_path,
......
Markdown is supported
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