]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-149879: Fix test_concurrent_futures on Cygwin (#150415)
authorVictor Stinner <vstinner@python.org>
Mon, 25 May 2026 21:04:14 +0000 (23:04 +0200)
committerGitHub <noreply@github.com>
Mon, 25 May 2026 21:04:14 +0000 (23:04 +0200)
On Cygwin, skip tests using "forkserver" start method.

Don't check BrokenProcessPool.__cause__, it's not set on Cygwin.

Lib/test/test_concurrent_futures/test_init.py
Lib/test/test_concurrent_futures/test_process_pool.py
Lib/test/test_concurrent_futures/util.py

index 5ea543bf74898214f8a4c385bb6465451b950378..ca612db17ce8021f4afa3f617e5e01e73e60eaa5 100644 (file)
@@ -147,6 +147,8 @@ class FailingInitializerResourcesTest(unittest.TestCase):
         self._test(ProcessPoolSpawnFailingInitializerTest)
 
     @support.skip_if_sanitizer("TSAN doesn't support threads after fork", thread=True)
+    @unittest.skipIf(sys.platform == "cygwin",
+                     "Forkserver is not available on Cygwin")
     def test_forkserver(self):
         self._test(ProcessPoolForkserverFailingInitializerTest)
 
index 731419a48bd1281e9b36d543beed1a0a734e1922..da70d910dc356143c7b1feb6de25cb477f6a1f1c 100644 (file)
@@ -115,11 +115,12 @@ class ProcessPoolExecutorTest(ExecutorTest):
             with self.assertRaises(BrokenProcessPool) as bpe:
                 future.result()
 
-        cause = bpe.exception.__cause__
-        self.assertIsInstance(cause, futures.process._RemoteTraceback)
-        self.assertIn(
-            f"terminated abruptly with exit code {exit_code}", cause.tb
-        )
+        if sys.platform != 'cygwin':
+            cause = bpe.exception.__cause__
+            self.assertIsInstance(cause, futures.process._RemoteTraceback)
+            self.assertIn(
+                f"terminated abruptly with exit code {exit_code}", cause.tb
+            )
 
     @warnings_helper.ignore_fork_in_thread_deprecation_warnings()
     @hashlib_helper.requires_hashdigest('md5')
index 2a9e55152b82d5484c1ea174d5b3c7d341628bb7..006360c8d941c9dcf7c304dbfad8d8b23fbe393d 100644 (file)
@@ -135,7 +135,7 @@ class ProcessPoolForkserverMixin(ExecutorMixin):
             _check_system_limits()
         except NotImplementedError:
             self.skipTest("ProcessPoolExecutor unavailable on this system")
-        if sys.platform == "win32":
+        if sys.platform in ("win32", "cygwin"):
             self.skipTest("require unix system")
         if support.check_sanitizer(thread=True):
             self.skipTest("TSAN doesn't support threads after fork")