[2.7] bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (#3042)
![](https://secure.gravatar.com/avatar/cc7737cd64a84f1b5c61a160798e97ee.jpg?s=120&d=mm&r=g)
https://github.com/python/cpython/commit/425680bbd2dc14ef8dc5d1928f44fc7cc43... commit: 425680bbd2dc14ef8dc5d1928f44fc7cc43018c4 branch: 2.7 author: Ammar Askar <ammar_askar@hotmail.com> committer: Victor Stinner <victor.stinner@gmail.com> date: 2017-08-09T16:54:53+02:00 summary: [2.7] bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (#3042) files: M Lib/test/test_thread.py diff --git a/Lib/test/test_thread.py b/Lib/test/test_thread.py index 2f9abe078fc..c8caa5ddff0 100644 --- a/Lib/test/test_thread.py +++ b/Lib/test/test_thread.py @@ -245,6 +245,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), "OK",
participants (1)
-
Victor Stinner