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

index 3909b75ccd4647d5e20de066f175227f1501cc6c..2e2655aee7fcf2d6bd1ae9f0fb993d71dee090a3 100644 (file)
@@ -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",