mirror of
https://github.com/python/cpython.git
synced 2026-10-28 10:25:05 +08:00
gh-160295: Fix race in test_forkserver_sigkill (GH-160296)
After a SIGKILL, the forkserver can no longer report the first child's exit status, so proc.join() returns with exit code 255 while the child may still be running. Wait for the event instead of checking it right after join().
This commit is contained in:
1 parent
2507a7fa73
commit
40c8edd2ca
1 file changed
+3
-1
@@ -994,7 +994,9 @@ class _TestProcess(BaseTestCase):
|
||||
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):
|
||||
|
||||
Reference in new issue
Block a user