From 776ec1e16728c6febd879e682afcd13d3bc7b53f Mon Sep 17 00:00:00 2001 From: Sam Gross Date: Wed, 12 Mar 2025 13:16:23 -0400 Subject: [PATCH] gh-110097: Fix flaky `test_timeout` in `test_concurrent_futures.test_process_pool` (gh-131108) 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 dc92d2d7e4af..0221c28b3ceb 100644 --- a/Lib/test/test_concurrent_futures/executor.py +++ b/Lib/test/test_concurrent_futures/executor.py @@ -69,7 +69,9 @@ class ExecutorTest: 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 -- 2.47.3