Skip to content

Commit 45d469d

Browse files
[3.13] gh-154272: Skip forkserver tests when the start method is unavailable (GH-154274) (GH-154472)
(cherry picked from commit 13e3f8a) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 55c90c4 commit 45d469d

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

Lib/test/test_concurrent_futures/util.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ def get_context(self):
130130
self.skipTest("require unix system")
131131
if support.check_sanitizer(thread=True):
132132
self.skipTest("TSAN doesn't support threads after fork")
133+
if "forkserver" not in multiprocessing.get_all_start_methods():
134+
self.skipTest("forkserver start method is not available")
133135
return super().get_context()
134136

135137
def create_event(self):

Lib/test/test_multiprocessing_forkserver/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import multiprocessing
12
import os.path
23
import sys
34
import unittest
@@ -9,5 +10,10 @@
910
if sys.platform == "win32":
1011
raise unittest.SkipTest("forkserver is not available on Windows")
1112

13+
# The forkserver start method requires passing file descriptors over a Unix
14+
# socket, which is not available on every platform (e.g. Solaris/illumos).
15+
if "forkserver" not in multiprocessing.get_all_start_methods():
16+
raise unittest.SkipTest("forkserver start method is not available")
17+
1218
def load_tests(*args):
1319
return support.load_package_tests(os.path.dirname(__file__), *args)

0 commit comments

Comments
 (0)