Skip to content

Commit a9a8c87

Browse files
authored
[3.11] gh-90867: test.support.wait_process() uses LONG_TIMEOUT (#99071) (#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 f09da28)
1 parent f7d2c94 commit a9a8c87

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/support/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -2078,15 +2078,15 @@ def wait_process(pid, *, exitcode, timeout=None):
20782078
20792079
Raise an AssertionError if the process exit code is not equal to exitcode.
20802080
2081-
If the process runs longer than timeout seconds (SHORT_TIMEOUT by default),
2081+
If the process runs longer than timeout seconds (LONG_TIMEOUT by default),
20822082
kill the process (if signal.SIGKILL is available) and raise an
20832083
AssertionError. The timeout feature is not available on Windows.
20842084
"""
20852085
if os.name != "nt":
20862086
import signal
20872087

20882088
if timeout is None:
2089-
timeout = SHORT_TIMEOUT
2089+
timeout = LONG_TIMEOUT
20902090
t0 = time.monotonic()
20912091
sleep = 0.001
20922092
max_sleep = 0.1
@@ -2097,7 +2097,7 @@ def wait_process(pid, *, exitcode, timeout=None):
20972097
# process is still running
20982098

20992099
dt = time.monotonic() - t0
2100-
if dt > SHORT_TIMEOUT:
2100+
if dt > timeout:
21012101
try:
21022102
os.kill(pid, signal.SIGKILL)
21032103
os.waitpid(pid, 0)

0 commit comments

Comments
 (0)