summaryrefslogtreecommitdiffstats
path: root/Lib/test/fork_wait.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/fork_wait.py')
-rw-r--r--Lib/test/fork_wait.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/fork_wait.py b/Lib/test/fork_wait.py
index 19b54ec..8c7c3aa 100644
--- a/Lib/test/fork_wait.py
+++ b/Lib/test/fork_wait.py
@@ -48,7 +48,12 @@ class ForkWait(unittest.TestCase):
for i in range(NUM_THREADS):
_thread.start_new(self.f, (i,))
- time.sleep(LONGSLEEP)
+ # busy-loop to wait for threads
+ deadline = time.monotonic() + 10.0
+ while len(self.alive) < NUM_THREADS:
+ time.sleep(0.1)
+ if time.monotonic() <= deadline:
+ break
a = sorted(self.alive.keys())
self.assertEqual(a, list(range(NUM_THREADS)))