From: Ammar Askar Date: Wed, 9 Aug 2017 08:51:43 +0000 (-0400) Subject: bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warning... X-Git-Tag: v3.7.0a1~304 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=88eee44a91c991dbbdf284fa220e2928b5de105c;p=thirdparty%2FPython%2Fcpython.git bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (#3032) --- diff --git a/Lib/test/test_thread.py b/Lib/test/test_thread.py index 3909b75ccd46..2e2655aee7fc 100644 --- a/Lib/test/test_thread.py +++ b/Lib/test/test_thread.py @@ -239,6 +239,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), b"OK",