Kaydet (Commit) 4388b425 authored tarafından Ammar Askar's avatar Ammar Askar Kaydeden (comit) Victor Stinner

[3.6] bpo-31150: Wait for child process in test_forkinthread to avoid thread…

[3.6] bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (#3041)
üst f3b89171
...@@ -239,6 +239,8 @@ class TestForkInThread(unittest.TestCase): ...@@ -239,6 +239,8 @@ class TestForkInThread(unittest.TestCase):
os._exit(0) os._exit(0)
else: # parent else: # parent
os.close(self.write_fd) os.close(self.write_fd)
pid, status = os.waitpid(pid, 0)
self.assertEqual(status, 0)
thread.start_new_thread(thread1, ()) thread.start_new_thread(thread1, ())
self.assertEqual(os.read(self.read_fd, 2), b"OK", self.assertEqual(os.read(self.read_fd, 2), b"OK",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment