]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-110662: multiprocessing test_async_timeout() increase timeout (GH-110663...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 11 Oct 2023 03:06:58 +0000 (05:06 +0200)
committerGitHub <noreply@github.com>
Wed, 11 Oct 2023 03:06:58 +0000 (05:06 +0200)
gh-110662: multiprocessing test_async_timeout() increase timeout (GH-110663)

Increase timeout from 1 second to 30 seconds, if not longer. The
important part is that apply_async() takes longer than TIMEOUT2.
(cherry picked from commit 790ecf6302e47b84da5d1c3b14dbdf070bce615b)

Co-authored-by: Victor Stinner <vstinner@python.org>
Lib/test/_test_multiprocessing.py

index 4c17088dd029c48d21910e32fb5d578895e523af..83e9d165c411daa9a25f2a8ec1f8b03df2b163df 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)