Skip to content

Commit 425680b

Browse files
ammaraskarvstinner
authored andcommitted
[2.7] bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (#3042)
1 parent 56e162a commit 425680b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Lib/test/test_thread.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ def thread1():
245245
os._exit(0)
246246
else: # parent
247247
os.close(self.write_fd)
248+
pid, status = os.waitpid(pid, 0)
249+
self.assertEqual(status, 0)
248250

249251
thread.start_new_thread(thread1, ())
250252
self.assertEqual(os.read(self.read_fd, 2), "OK",

0 commit comments

Comments
 (0)