mirror of https://github.com/python/cpython
bpo-31160: Fix test_builtin for zombie process (#3043)
PtyTests.run_child() now calls os.waitpid() to read the exit status of the child process to avoid creating zombie process and leaking processes in the background.
This commit is contained in:
parent
122081deef
commit
4baca1b0f7
|
@ -1568,6 +1568,10 @@ class PtyTests(unittest.TestCase):
|
||||||
self.fail("got %d lines in pipe but expected 2, child output was:\n%s"
|
self.fail("got %d lines in pipe but expected 2, child output was:\n%s"
|
||||||
% (len(lines), child_output))
|
% (len(lines), child_output))
|
||||||
os.close(fd)
|
os.close(fd)
|
||||||
|
|
||||||
|
pid, status = os.waitpid(pid, 0)
|
||||||
|
self.assertEqual(status, 0)
|
||||||
|
|
||||||
return lines
|
return lines
|
||||||
|
|
||||||
def check_input_tty(self, prompt, terminal_input, stdio_encoding=None):
|
def check_input_tty(self, prompt, terminal_input, stdio_encoding=None):
|
||||||
|
|
Loading…
Reference in New Issue