mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
Tests call sleeping_retry() with SHORT_TIMEOUT (#93870)
Tests now call busy_retry() and sleeping_retry() with SHORT_TIMEOUT or LONG_TIMEOUT (of test.support), rather than hardcoded constants. Add also WAIT_ACTIVE_CHILDREN_TIMEOUT constant to _test_multiprocessing.
This commit is contained in:
parent
46e455f21c
commit
50e0866f87
6 changed files with 16 additions and 9 deletions
|
|
@ -62,7 +62,8 @@ def f(x):
|
|||
pool.map_async(f, [1, 2, 3], callback=results.extend)
|
||||
|
||||
# up to 1 min to report the results
|
||||
for _ in support.sleeping_retry(60, "Timed out waiting for results"):
|
||||
for _ in support.sleeping_retry(support.LONG_TIMEOUT,
|
||||
"Timed out waiting for results"):
|
||||
if results:
|
||||
break
|
||||
|
||||
|
|
@ -93,7 +94,8 @@ def f(x):
|
|||
with Pool(5) as pool:
|
||||
pool.map_async(int, [1, 4, 9], callback=results.extend)
|
||||
# up to 1 min to report the results
|
||||
for _ in support.sleeping_retry(60, "Timed out waiting for results"):
|
||||
for _ in support.sleeping_retry(support.LONG_TIMEOUT,
|
||||
"Timed out waiting for results"):
|
||||
if results:
|
||||
break
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue