mirror of
https://github.com/python/cpython.git
synced 2025-09-01 14:38:00 +00:00
bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (#3032)
This commit is contained in:
parent
c82b7f332a
commit
88eee44a91
1 changed files with 2 additions and 0 deletions
|
@ -239,6 +239,8 @@ class TestForkInThread(unittest.TestCase):
|
||||||
os._exit(0)
|
os._exit(0)
|
||||||
else: # parent
|
else: # parent
|
||||||
os.close(self.write_fd)
|
os.close(self.write_fd)
|
||||||
|
pid, status = os.waitpid(pid, 0)
|
||||||
|
self.assertEqual(status, 0)
|
||||||
|
|
||||||
thread.start_new_thread(thread1, ())
|
thread.start_new_thread(thread1, ())
|
||||||
self.assertEqual(os.read(self.read_fd, 2), b"OK",
|
self.assertEqual(os.read(self.read_fd, 2), b"OK",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue