]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-110662: multiprocessing test_async_timeout() increase timeout (#110663)
authorVictor Stinner <vstinner@python.org>
Wed, 11 Oct 2023 02:36:06 +0000 (04:36 +0200)
committerGitHub <noreply@github.com>
Wed, 11 Oct 2023 02:36:06 +0000 (02:36 +0000)
Increase timeout from 1 second to 30 seconds, if not longer. The
important part is that apply_async() takes longer than TIMEOUT2.

Lib/test/_test_multiprocessing.py

index 26649ed962bc501789cfffc0e5180387a52c21e9..0b333ca3b7e9dcd601b34f0770d0832988ccb049 100644 (file)
@@ -2578,7 +2578,7 @@ class _TestPool(BaseTestCase):
         self.assertTimingAlmostEqual(get.elapsed, TIMEOUT1)
 
     def test_async_timeout(self):
-        res = self.pool.apply_async(sqr, (6, TIMEOUT2 + 1.0))
+        res = self.pool.apply_async(sqr, (6, TIMEOUT2 + support.SHORT_TIMEOUT))
         get = TimingWrapper(res.get)
         self.assertRaises(multiprocessing.TimeoutError, get, timeout=TIMEOUT2)
         self.assertTimingAlmostEqual(get.elapsed, TIMEOUT2)