]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-120635: Avoid leaking processes in test_pyrepl (#120676)
authorVictor Stinner <vstinner@python.org>
Wed, 19 Jun 2024 13:14:29 +0000 (15:14 +0200)
committerGitHub <noreply@github.com>
Wed, 19 Jun 2024 13:14:29 +0000 (15:14 +0200)
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.

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