Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e6cfdef

Browse files
authored
bpo-31510: Fix multiprocessing test_many_processes() on macOS (#3857)
On macOS, a process can exit with -SIGKILL if it is killed "early" with SIGTERM.
1 parent 4337a0d commit e6cfdef

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Lib/test/_test_multiprocessing.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,13 @@ def test_many_processes(self):
501501
for p in procs:
502502
join_process(p)
503503
if os.name != 'nt':
504+
exitcodes = [-signal.SIGTERM]
505+
if sys.platform == 'darwin':
506+
# bpo-31510: On macOS, killing a freshly started process with
507+
# SIGTERM sometimes kills the process with SIGKILL.
508+
exitcodes.append(-signal.SIGKILL)
504509
for p in procs:
505-
self.assertEqual(p.exitcode, -signal.SIGTERM)
510+
self.assertIn(p.exitcode, exitcodes)
506511

507512
def test_lose_target_ref(self):
508513
c = DummyCallable()

0 commit comments

Comments
 (0)