From 192e1fdee77f1d67d54312da09c042381c8a5ff5 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 25 May 2026 19:19:11 +0200 Subject: [PATCH 1/2] gh-149879: Fix test_concurrent_futures on Cygwin On Cygwin, skip tests using "forkserver" start method. --- Lib/test/test_concurrent_futures/test_init.py | 2 ++ Lib/test/test_concurrent_futures/util.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_concurrent_futures/test_init.py b/Lib/test/test_concurrent_futures/test_init.py index 5ea543bf748982..ca612db17ce802 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/util.py b/Lib/test/test_concurrent_futures/util.py index 2a9e55152b82d5..006360c8d941c9 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") From c0ea488f9a6f9494542924bb941c51615243f5bc Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 25 May 2026 20:23:16 +0200 Subject: [PATCH 2/2] Don't check BrokenProcessPool.__cause__ On Cygwin, the cause is not set. --- Lib/test/test_concurrent_futures/test_process_pool.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Lib/test/test_concurrent_futures/test_process_pool.py b/Lib/test/test_concurrent_futures/test_process_pool.py index 731419a48bd128..da70d910dc3561 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')