From: Sam Gross Date: Wed, 12 Mar 2025 17:16:23 +0000 (-0400) Subject: gh-110097: Fix flaky `test_timeout` in `test_concurrent_futures.test_process_pool... X-Git-Tag: v3.14.0a6~55 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=776ec1e16728c6febd879e682afcd13d3bc7b53f;p=thirdparty%2FPython%2Fcpython.git 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. --- 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