https://github.com/python/cpython/commit/88eee44a91c991dbbdf284fa220e2928b5d... commit: 88eee44a91c991dbbdf284fa220e2928b5de105c branch: master author: Ammar Askar <ammar_askar@hotmail.com> committer: Victor Stinner <victor.stinner@gmail.com> date: 2017-08-09T10:51:43+02:00 summary: bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (#3032) files: M Lib/test/test_thread.py diff --git a/Lib/test/test_thread.py b/Lib/test/test_thread.py index 3909b75ccd4..2e2655aee7f 100644 --- a/Lib/test/test_thread.py +++ b/Lib/test/test_thread.py @@ -239,6 +239,8 @@ def thread1(): 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",