[Python-checkins] [3.6] bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (#3041)

Victor Stinner webhook-mailer at python.org
Wed Aug 9 10:59:25 EDT 2017


https://github.com/python/cpython/commit/4388b4257abf3b9c348cf4db8c6144dcc07f3e98
commit: 4388b4257abf3b9c348cf4db8c6144dcc07f3e98
branch: 3.6
author: Ammar Askar <ammar_askar at hotmail.com>
committer: Victor Stinner <victor.stinner at gmail.com>
date: 2017-08-09T16:59:21+02:00
summary:

[3.6] bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (#3041)

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",



More information about the Python-checkins mailing list