Skip to content

Commit 88eee44

Browse files
ammaraskarvstinner
authored andcommitted
bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (#3032)
1 parent c82b7f3 commit 88eee44

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Lib/test/test_thread.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ def thread1():
239239
os._exit(0)
240240
else: # parent
241241
os.close(self.write_fd)
242+
pid, status = os.waitpid(pid, 0)
243+
self.assertEqual(status, 0)
242244

243245
thread.start_new_thread(thread1, ())
244246
self.assertEqual(os.read(self.read_fd, 2), b"OK",

0 commit comments

Comments
 (0)