]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-110097: Fix flaky `test_timeout` in `test_concurrent_futures.test_process_pool...
authorSam Gross <colesbury@gmail.com>
Wed, 12 Mar 2025 17:16:23 +0000 (13:16 -0400)
committerGitHub <noreply@github.com>
Wed, 12 Mar 2025 17:16:23 +0000 (13:16 -0400)
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

index dc92d2d7e4af92cb2c75ff4bbe81b0d97692e77e..0221c28b3ceb8b729eb1a4acc1ae19252bb1013b 100644 (file)
@@ -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