From 88eee44a91c991dbbdf284fa220e2928b5de105c Mon Sep 17 00:00:00 2001
From: Ammar Askar <ammar_askar@hotmail.com>
Date: Wed, 9 Aug 2017 04:51:43 -0400
Subject: bpo-31150: Wait for child process in test_forkinthread to avoid
 thread reaped warnings (#3032)

---
 Lib/test/test_thread.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Lib/test/test_thread.py b/Lib/test/test_thread.py
index 3909b75..2e2655a 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",
-- 
cgit v0.12

