[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 0f3e36454d)

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Miss Islington (bot) 2024-06-19 15:38:37 +02:00 committed by GitHub
parent 4ce1246a99
commit bb5d19440b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View 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