From 425680bbd2dc14ef8dc5d1928f44fc7cc43018c4 Mon Sep 17 00:00:00 2001 From: Ammar Askar Date: Wed, 9 Aug 2017 10:54:53 -0400 Subject: [PATCH] [2.7] bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (#3042) --- Lib/test/test_thread.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/test/test_thread.py b/Lib/test/test_thread.py index 2f9abe078f..c8caa5ddff 100644 --- a/Lib/test/test_thread.py +++ b/Lib/test/test_thread.py @@ -245,6 +245,8 @@ class TestForkInThread(unittest.TestCase): os._exit(0) else: # parent os.close(self.write_fd) + pid, status = os.waitpid(pid, 0) + self.assertEqual(status, 0) thread.start_new_thread(thread1, ()) self.assertEqual(os.read(self.read_fd, 2), "OK", -- 2.50.1