diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-10-05 20:03:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-05 20:03:53 (GMT) |
commit | 11137d38222f7874c8cbffe91bd656983288a9b0 (patch) | |
tree | ea656052dbfb2b984d4fe4d4bb6e351ca243845b /Lib/test/_test_multiprocessing.py | |
parent | 2ab41c8fbc6beafebe44f232227cb593cbe7a0bd (diff) | |
download | cpython-11137d38222f7874c8cbffe91bd656983288a9b0.zip cpython-11137d38222f7874c8cbffe91bd656983288a9b0.tar.gz cpython-11137d38222f7874c8cbffe91bd656983288a9b0.tar.bz2 |
[3.12] gh-109840: Fix multiprocessing test_waitfor_timeout() (GH-110428) (#110430)
gh-109840: Fix multiprocessing test_waitfor_timeout() (GH-110428)
Don't measure the CI performance: don't fail if cond.wait_for() takes
longer than 1 second on a slow CI.
(cherry picked from commit 5eae8dc2cb832af6ae1ee340fb0194107fe3bd6e)
Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r-- | Lib/test/_test_multiprocessing.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 34027b0..80ebdbf 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -1651,12 +1651,12 @@ class _TestCondition(BaseTestCase): def _test_waitfor_timeout_f(cls, cond, state, success, sem): sem.release() with cond: - expected = 0.1 + expected = 0.100 dt = time.monotonic() result = cond.wait_for(lambda : state.value==4, timeout=expected) dt = time.monotonic() - dt # borrow logic in assertTimeout() from test/lock_tests.py - if not result and expected * 0.6 < dt < expected * 10.0: + if not result and expected * 0.6 <= dt: success.value = True @unittest.skipUnless(HAS_SHAREDCTYPES, 'needs sharedctypes') @@ -1675,7 +1675,7 @@ class _TestCondition(BaseTestCase): # Only increment 3 times, so state == 4 is never reached. for i in range(3): - time.sleep(0.01) + time.sleep(0.010) with cond: state.value += 1 cond.notify() |