Skip to content

Commit a503bdf

Browse files
[3.11] gh-109840: Fix multiprocessing test_waitfor_timeout() (GH-110428) (#110431)
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 5eae8dc) Co-authored-by: Victor Stinner <[email protected]>
1 parent 8da3367 commit a503bdf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/_test_multiprocessing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,12 +1650,12 @@ def test_waitfor(self):
16501650
def _test_waitfor_timeout_f(cls, cond, state, success, sem):
16511651
sem.release()
16521652
with cond:
1653-
expected = 0.1
1653+
expected = 0.100
16541654
dt = time.monotonic()
16551655
result = cond.wait_for(lambda : state.value==4, timeout=expected)
16561656
dt = time.monotonic() - dt
16571657
# borrow logic in assertTimeout() from test/lock_tests.py
1658-
if not result and expected * 0.6 < dt < expected * 10.0:
1658+
if not result and expected * 0.6 <= dt:
16591659
success.value = True
16601660

16611661
@unittest.skipUnless(HAS_SHAREDCTYPES, 'needs sharedctypes')
@@ -1674,7 +1674,7 @@ def test_waitfor_timeout(self):
16741674

16751675
# Only increment 3 times, so state == 4 is never reached.
16761676
for i in range(3):
1677-
time.sleep(0.01)
1677+
time.sleep(0.010)
16781678
with cond:
16791679
state.value += 1
16801680
cond.notify()

0 commit comments

Comments
 (0)