Skip to content

Commit ae5317d

Browse files
[3.11] gh-90867: test.support.wait_process() uses LONG_TIMEOUT (GH-99071) (GH-99098)
The test.support.wait_process() function now uses a timeout of LONG_TIMEOUT seconds by default, instead of SHORT_TIMEOUT. It doesn't matter if a Python buildbot is slower, it only matters that the process completes. The timeout should just be shorter than "forever". (cherry picked from commit a9a8c87) Co-authored-by: Victor Stinner <[email protected]> (cherry picked from commit f09da28)
1 parent 0f45b2e commit ae5317d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/support/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,15 +1986,15 @@ def wait_process(pid, *, exitcode, timeout=None):
19861986
19871987
Raise an AssertionError if the process exit code is not equal to exitcode.
19881988
1989-
If the process runs longer than timeout seconds (SHORT_TIMEOUT by default),
1989+
If the process runs longer than timeout seconds (LONG_TIMEOUT by default),
19901990
kill the process (if signal.SIGKILL is available) and raise an
19911991
AssertionError. The timeout feature is not available on Windows.
19921992
"""
19931993
if os.name != "nt":
19941994
import signal
19951995

19961996
if timeout is None:
1997-
timeout = SHORT_TIMEOUT
1997+
timeout = LONG_TIMEOUT
19981998
t0 = time.monotonic()
19991999
sleep = 0.001
20002000
max_sleep = 0.1
@@ -2005,7 +2005,7 @@ def wait_process(pid, *, exitcode, timeout=None):
20052005
# process is still running
20062006

20072007
dt = time.monotonic() - t0
2008-
if dt > SHORT_TIMEOUT:
2008+
if dt > timeout:
20092009
try:
20102010
os.kill(pid, signal.SIGKILL)
20112011
os.waitpid(pid, 0)

0 commit comments

Comments
 (0)