From bb5d19440b8056bd2b272239a2c0b1c2063b3af6 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Wed, 19 Jun 2024 15:38:37 +0200 Subject: [3.13] gh-120635: Avoid leaking processes in test_pyrepl (GH-120676) (#120741) gh-120635: Avoid leaking processes in test_pyrepl (GH-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. (cherry picked from commit 0f3e36454d754026d6c510053ff1e4b22ae80cd9) Co-authored-by: Victor Stinner --- Lib/test/test_pyrepl/test_pyrepl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py index 41ba595..adc55f2 100644 --- a/Lib/test/test_pyrepl/test_pyrepl.py +++ b/Lib/test/test_pyrepl/test_pyrepl.py @@ -890,5 +890,5 @@ class TestMain(TestCase): 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 -- cgit v0.12