]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-154272: Skip forkserver tests when the start method is unavailable (GH-154274)
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 22 Jul 2026 11:15:41 +0000 (14:15 +0300)
committerGitHub <noreply@github.com>
Wed, 22 Jul 2026 11:15:41 +0000 (14:15 +0300)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Lib/test/test_concurrent_futures/util.py
Lib/test/test_multiprocessing_forkserver/__init__.py

index 006360c8d941c9dcf7c304dbfad8d8b23fbe393d..9dc1d057e75b4bc7e5347764c7c9f4a795d9f643 100644 (file)
@@ -139,6 +139,8 @@ class ProcessPoolForkserverMixin(ExecutorMixin):
             self.skipTest("require unix system")
         if support.check_sanitizer(thread=True):
             self.skipTest("TSAN doesn't support threads after fork")
+        if "forkserver" not in multiprocessing.get_all_start_methods():
+            self.skipTest("forkserver start method is not available")
         return super().get_context()
 
     def create_event(self):
index c58375e2861c62e638147d2b3147d0052c8e3ba1..600285cbf613003bae4adfa091b11bd3fff1bd8e 100644 (file)
@@ -1,3 +1,4 @@
+import multiprocessing
 import os.path
 import sys
 import unittest
@@ -12,5 +13,10 @@ if sys.platform in ("win32", "cygwin"):
 if not support.has_fork_support:
     raise unittest.SkipTest("requires working os.fork()")
 
+# The forkserver start method requires passing file descriptors over a Unix
+# socket, which is not available on every platform (e.g. Solaris/illumos).
+if "forkserver" not in multiprocessing.get_all_start_methods():
+    raise unittest.SkipTest("forkserver start method is not available")
+
 def load_tests(*args):
     return support.load_package_tests(os.path.dirname(__file__), *args)