https://github.com/python/cpython/commit/0f3e36454d754026d6c510053ff1e4b22ae80cd9
commit: 0f3e36454d754026d6c510053ff1e4b22ae80cd9
branch: main
author: Victor Stinner <[email protected]>
committer: vstinner <[email protected]>
date: 2024-06-19T15:14:29+02:00
summary:
gh-120635: Avoid leaking processes in test_pyrepl (#120676)
If the child process takes longer than SHORT_TIMEOUT seconds to
complete, kill the process but then wait until it completes with no
timeout to not leak child processes.
files:
M Lib/test/test_pyrepl/test_pyrepl.py
diff --git a/Lib/test/test_pyrepl/test_pyrepl.py
b/Lib/test/test_pyrepl/test_pyrepl.py
index 41ba5959a1ec34..adc55f28f08a1e 100644
--- a/Lib/test/test_pyrepl/test_pyrepl.py
+++ b/Lib/test/test_pyrepl/test_pyrepl.py
@@ -890,5 +890,5 @@ def run_repl(self, repl_input: str | list[str], env: dict |
None = None) -> tupl
exit_code = process.wait(timeout=SHORT_TIMEOUT)
except subprocess.TimeoutExpired:
process.kill()
- exit_code = process.returncode
+ exit_code = process.wait()
return "\n".join(output), exit_code
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]