Skip to content

Commit 0c5a019

Browse files
committed
Update test
1 parent faadd30 commit 0c5a019

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/test/test_thread.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ def mutator(shared, stop, prefix, burst):
366366
def nop(i, **kwargs):
367367
pass
368368

369+
DELAY = 1.0
369370
stop = thread.lock()
370371
shared = {f"base_{i}": i for i in range(20000)}
371372
n = 4
@@ -383,8 +384,8 @@ def nop(i, **kwargs):
383384
stop.acquire()
384385
# wait for all mutator threads stop.
385386
wait_t = time.monotonic()
386-
while len(results) < n and time.monotonic() - wait_t < 5.0:
387-
time.sleep(0.1)
387+
while len(results) < n and time.monotonic() - wait_t < DELAY:
388+
time.sleep(0.01)
388389

389390

390391
class Barrier:

0 commit comments

Comments
 (0)