diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-10-02 15:27:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-02 15:27:34 (GMT) |
commit | e6cfdefa0c2f5bda177e49b228c2c7528f7c239c (patch) | |
tree | 89727fb17aa54d26f894acac7d50d96007ecdc3e /Lib/test | |
parent | 4337a0d9955f0855ba38ef30feec3858d304abf0 (diff) | |
download | cpython-e6cfdefa0c2f5bda177e49b228c2c7528f7c239c.zip cpython-e6cfdefa0c2f5bda177e49b228c2c7528f7c239c.tar.gz cpython-e6cfdefa0c2f5bda177e49b228c2c7528f7c239c.tar.bz2 |
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.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/_test_multiprocessing.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index fda20f1..8e004e2 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -501,8 +501,13 @@ class _TestProcess(BaseTestCase): for p in procs: join_process(p) if os.name != 'nt': + exitcodes = [-signal.SIGTERM] + if sys.platform == 'darwin': + # bpo-31510: On macOS, killing a freshly started process with + # SIGTERM sometimes kills the process with SIGKILL. + exitcodes.append(-signal.SIGKILL) for p in procs: - self.assertEqual(p.exitcode, -signal.SIGTERM) + self.assertIn(p.exitcode, exitcodes) def test_lose_target_ref(self): c = DummyCallable() |