Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[3.10] [3.11] gh-90867: test.support.wait_process() uses LONG_TIMEOUT (GH-99071) (GH-99098) #99099

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1986,15 +1986,15 @@ 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.
"""
if os.name != "nt":
import signal

if timeout is None:
timeout = SHORT_TIMEOUT
timeout = LONG_TIMEOUT
t0 = time.monotonic()
sleep = 0.001
max_sleep = 0.1
Expand All @@ -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)
Expand Down