Commit 81950495 authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

bpo-32692: Fix test_threading.test_set_and_clear() (GH-8331)

Increase the timeout: give timeout x 4 instead of timeout x 2 to
threads to wait until the Event is set, but reduce the sleep from 500
ms to 250 ms. So the test should be more reliable and faster!
parent 686b4b5f
......@@ -405,12 +405,13 @@ class EventTests(BaseTestCase):
# cleared before the waiting thread is woken up.
evt = self.eventtype()
results = []
timeout = 0.250
N = 5
def f():
results.append(evt.wait(1))
results.append(evt.wait(timeout * 4))
b = Bunch(f, N)
b.wait_for_started()
time.sleep(0.5)
time.sleep(timeout)
evt.set()
evt.clear()
b.wait_for_finished()
......
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