Skip to content

Commit 5cb54c9

Browse files
authored
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.
1 parent c549837 commit 5cb54c9

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

Lib/test/test_concurrent_futures/test_init.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ def test_spawn(self):
147147
self._test(ProcessPoolSpawnFailingInitializerTest)
148148

149149
@support.skip_if_sanitizer("TSAN doesn't support threads after fork", thread=True)
150+
@unittest.skipIf(sys.platform == "cygwin",
151+
"Forkserver is not available on Cygwin")
150152
def test_forkserver(self):
151153
self._test(ProcessPoolForkserverFailingInitializerTest)
152154

Lib/test/test_concurrent_futures/test_process_pool.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,12 @@ def test_traceback_when_child_process_terminates_abruptly(self):
115115
with self.assertRaises(BrokenProcessPool) as bpe:
116116
future.result()
117117

118-
cause = bpe.exception.__cause__
119-
self.assertIsInstance(cause, futures.process._RemoteTraceback)
120-
self.assertIn(
121-
f"terminated abruptly with exit code {exit_code}", cause.tb
122-
)
118+
if sys.platform != 'cygwin':
119+
cause = bpe.exception.__cause__
120+
self.assertIsInstance(cause, futures.process._RemoteTraceback)
121+
self.assertIn(
122+
f"terminated abruptly with exit code {exit_code}", cause.tb
123+
)
123124

124125
@warnings_helper.ignore_fork_in_thread_deprecation_warnings()
125126
@hashlib_helper.requires_hashdigest('md5')

Lib/test/test_concurrent_futures/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def get_context(self):
135135
_check_system_limits()
136136
except NotImplementedError:
137137
self.skipTest("ProcessPoolExecutor unavailable on this system")
138-
if sys.platform == "win32":
138+
if sys.platform in ("win32", "cygwin"):
139139
self.skipTest("require unix system")
140140
if support.check_sanitizer(thread=True):
141141
self.skipTest("TSAN doesn't support threads after fork")

0 commit comments

Comments
 (0)