From: Ammar Askar Date: Wed, 9 Aug 2017 14:54:53 +0000 (-0400) Subject: [2.7] bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped... X-Git-Tag: v2.7.14rc1~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=425680bbd2dc14ef8dc5d1928f44fc7cc43018c4;p=python [2.7] bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (#3042) --- 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",