diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 00de9d0ac921d2..d267c9d3dfa8a9 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -994,7 +994,9 @@ def check_forkserver_death(self, signum): self.assertEqual(proc2.exitcode, 0) proc.join() - self.assertTrue(evt.is_set()) + # After SIGKILL, join() can return (exitcode 255) as soon as the + # status pipe is closed, before the orphaned child has run. + self.assertTrue(evt.wait(support.SHORT_TIMEOUT)) self.assertIn(proc.exitcode, (0, 255)) def test_forkserver_sigint(self):