mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #20910: Make tests more reliable, less dependent on time
* Tolerate 10 seconds instead of 3 seconds for slow test * Faster test, use sleep of 100 ms instead of 1 sec * Replace a number of iterations with an explicit deadline for the timeout
This commit is contained in:
parent
f8cbf78bbd
commit
1e48eb3b9b
5 changed files with 19 additions and 10 deletions
|
@ -18,7 +18,8 @@ class Wait3Test(ForkWait):
|
|||
# This many iterations can be required, since some previously run
|
||||
# tests (e.g. test_ctypes) could have spawned a lot of children
|
||||
# very quickly.
|
||||
for i in range(30):
|
||||
deadline = time.monotonic() + 10.0
|
||||
while time.monotonic() <= deadline:
|
||||
# wait3() shouldn't hang, but some of the buildbots seem to hang
|
||||
# in the forking tests. This is an attempt to fix the problem.
|
||||
spid, status, rusage = os.wait3(os.WNOHANG)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue