]> granicus.if.org Git - python/commitdiff
[2.7] bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped...
authorAmmar Askar <ammar_askar@hotmail.com>
Wed, 9 Aug 2017 14:54:53 +0000 (10:54 -0400)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 9 Aug 2017 14:54:53 +0000 (16:54 +0200)
Lib/test/test_thread.py

index 2f9abe078fc2ea4ffb317616f53f15c943de1399..c8caa5ddff03a0477ddedd2f3cca975d83fa882a 100644 (file)
@@ -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",