]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-120635: Avoid leaking processes in test_pyrepl (GH-120676) (#120741)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 19 Jun 2024 13:38:37 +0000 (15:38 +0200)
committerGitHub <noreply@github.com>
Wed, 19 Jun 2024 13:38:37 +0000 (13:38 +0000)
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 <vstinner@python.org>
Lib/test/test_pyrepl/test_pyrepl.py

index 41ba5959a1ec34ee614652a07e96550cc7ae6abe..adc55f28f08a1e4e912b98a2aef5c38acf1a90e1 100644 (file)
@@ -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