We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7a5d0b5 commit 694c627Copy full SHA for 694c627
1 file changed
Lib/test/test_thread.py
@@ -378,20 +378,20 @@ def nop(i, **kwargs):
378
args=(shared, stop, f"dynamic_{i}", 1000)
379
thread.start_new_thread(mutator, args)
380
381
- snt = 32
+ snt = 16
382
for i in range(snt):
383
try:
384
thread.start_new_thread(nop, (i,), shared)
385
except RuntimeError:
386
break
387
388
stop.acquire()
389
- self.assertTrue(True, "test done")
390
- # wait for all mutator threads stop.
391
DELAY = 1.0
392
- wait_t = time.monotonic()
393
- while len(results) < n and time.monotonic() - wait_t < DELAY:
394
- time.sleep(0.001)
+ # wait for all mutator threads stop.
+ for _ in support.sleeping_retry(DELAY):
+ if len(results) == n:
+ break
+ self.assertTrue(True, "test successful")
395
396
397
class Barrier:
0 commit comments