summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-11-04 15:20:35 (GMT)
committerGitHub <noreply@github.com>2022-11-04 15:20:35 (GMT)
commitae5317d309f3b730c25797b07b3fbfc3a1357e7d (patch)
treecd6dc93fee8d65253da485edf9c0feb79a6104ff /Lib/test
parent0f45b2edac52a4b64e81fd75c5230d41d0abc8ca (diff)
downloadcpython-ae5317d309f3b730c25797b07b3fbfc3a1357e7d.zip
cpython-ae5317d309f3b730c25797b07b3fbfc3a1357e7d.tar.gz
cpython-ae5317d309f3b730c25797b07b3fbfc3a1357e7d.tar.bz2
[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 a9a8c8712665377cfa83af4b632b0db529ec1853) Co-authored-by: Victor Stinner <vstinner@python.org> (cherry picked from commit f09da28768b77713566e932e912f107b6b57e8fd)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/support/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index c9a80c2..b7cf1e2 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -1986,7 +1986,7 @@ def wait_process(pid, *, exitcode, timeout=None):
Raise an AssertionError if the process exit code is not equal to exitcode.
- If the process runs longer than timeout seconds (SHORT_TIMEOUT by default),
+ If the process runs longer than timeout seconds (LONG_TIMEOUT by default),
kill the process (if signal.SIGKILL is available) and raise an
AssertionError. The timeout feature is not available on Windows.
"""
@@ -1994,7 +1994,7 @@ def wait_process(pid, *, exitcode, timeout=None):
import signal
if timeout is None:
- timeout = SHORT_TIMEOUT
+ timeout = LONG_TIMEOUT
t0 = time.monotonic()
sleep = 0.001
max_sleep = 0.1
@@ -2005,7 +2005,7 @@ def wait_process(pid, *, exitcode, timeout=None):
# process is still running
dt = time.monotonic() - t0
- if dt > SHORT_TIMEOUT:
+ if dt > timeout:
try:
os.kill(pid, signal.SIGKILL)
os.waitpid(pid, 0)