Skip to content

Commit b420ac0

Browse files
committed
gh-109840: Fix multiprocessing test_waitfor_timeout()
Don't measure the CI performance: don't fail if cond.wait_for() takes longer than 1 second on a slow CI.
1 parent 0db2f14 commit b420ac0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Lib/test/_test_multiprocessing.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,12 +1651,9 @@ def test_waitfor(self):
16511651
def _test_waitfor_timeout_f(cls, cond, state, success, sem):
16521652
sem.release()
16531653
with cond:
1654-
expected = 0.1
1655-
dt = time.monotonic()
1654+
expected = 0.100
16561655
result = cond.wait_for(lambda : state.value==4, timeout=expected)
1657-
dt = time.monotonic() - dt
1658-
# borrow logic in assertTimeout() from test/lock_tests.py
1659-
if not result and expected * 0.6 < dt < expected * 10.0:
1656+
if not result:
16601657
success.value = True
16611658

16621659
@unittest.skipUnless(HAS_SHAREDCTYPES, 'needs sharedctypes')
@@ -1675,7 +1672,7 @@ def test_waitfor_timeout(self):
16751672

16761673
# Only increment 3 times, so state == 4 is never reached.
16771674
for i in range(3):
1678-
time.sleep(0.01)
1675+
time.sleep(0.010)
16791676
with cond:
16801677
state.value += 1
16811678
cond.notify()

0 commit comments

Comments
 (0)