https://github.com/python/cpython/commit/5cb54c9c09ce64b26d1d922f36093969b4ca4c81
commit: 5cb54c9c09ce64b26d1d922f36093969b4ca4c81
branch: main
author: Victor Stinner <[email protected]>
committer: vstinner <[email protected]>
date: 2026-05-25T23:04:14+02:00
summary:

gh-149879: Fix test_concurrent_futures on Cygwin (#150415)

On Cygwin, skip tests using "forkserver" start method.

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

files:
M Lib/test/test_concurrent_futures/test_init.py
M Lib/test/test_concurrent_futures/test_process_pool.py
M Lib/test/test_concurrent_futures/util.py

diff --git a/Lib/test/test_concurrent_futures/test_init.py 
b/Lib/test/test_concurrent_futures/test_init.py
index 5ea543bf7489821..ca612db17ce8021 100644
--- a/Lib/test/test_concurrent_futures/test_init.py
+++ b/Lib/test/test_concurrent_futures/test_init.py
@@ -147,6 +147,8 @@ def test_spawn(self):
         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)
 
diff --git a/Lib/test/test_concurrent_futures/test_process_pool.py 
b/Lib/test/test_concurrent_futures/test_process_pool.py
index 731419a48bd1281..da70d910dc35614 100644
--- a/Lib/test/test_concurrent_futures/test_process_pool.py
+++ b/Lib/test/test_concurrent_futures/test_process_pool.py
@@ -115,11 +115,12 @@ def 
test_traceback_when_child_process_terminates_abruptly(self):
             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')
diff --git a/Lib/test/test_concurrent_futures/util.py 
b/Lib/test/test_concurrent_futures/util.py
index 2a9e55152b82d54..006360c8d941c9d 100644
--- a/Lib/test/test_concurrent_futures/util.py
+++ b/Lib/test/test_concurrent_futures/util.py
@@ -135,7 +135,7 @@ def get_context(self):
             _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")

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to