From 77544f42b4266b6f83e9f52e879b72e8da03860a Mon Sep 17 00:00:00 2001 From: Sam Gross Date: Tue, 11 Mar 2025 19:15:45 +0000 Subject: [PATCH] gh-110097: Fix flaky `test_timeout` in `test_concurrent_futures.test_process_pool` On heavily loaded systems, the launch of the workers to run `time.sleep(0)` can take longer than the five second timeout. --- Lib/test/test_concurrent_futures/executor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_concurrent_futures/executor.py b/Lib/test/test_concurrent_futures/executor.py index dc92d2d7e4af92..0221c28b3ceb8b 100644 --- a/Lib/test/test_concurrent_futures/executor.py +++ b/Lib/test/test_concurrent_futures/executor.py @@ -69,7 +69,9 @@ def test_map_timeout(self): else: self.fail('expected TimeoutError') - self.assertEqual([None, None], results) + # gh-110097: On heavily loaded systems, the launch of the worker may + # take longer than the specified timeout. + self.assertIn(results, ([None, None], [None], [])) def test_shutdown_race_issue12456(self): # Issue #12456: race condition at shutdown where trying to post a