Skip to content

Commit d0c5e6d

Browse files
authored
Increase fudge factor for sleeping (#3411)
1 parent 370c2e5 commit d0c5e6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/trio/_tests/test_timeouts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async def check_takes_about(f: Callable[[], Awaitable[T]], expected_dur: float)
3333
result = await outcome.acapture(f)
3434
dur = time.perf_counter() - start
3535
print(dur / expected_dur)
36-
# 1.5 is an arbitrary fudge factor because there's always some delay
36+
# 2.0 is an arbitrary fudge factor because there's always some delay
3737
# between when we become eligible to wake up and when we actually do. We
3838
# used to sleep for 0.05, and regularly observed overruns of 1.6x on
3939
# Appveyor, and then started seeing overruns of 2.3x on Travis's macOS, so
@@ -52,7 +52,7 @@ async def check_takes_about(f: Callable[[], Awaitable[T]], expected_dur: float)
5252
# lol floating point we got slightly different rounding errors. (That
5353
# value above is exactly 128 ULPs below 1.0, which would make sense if it
5454
# started as a 1 ULP error at a different dynamic range.)
55-
assert (1 - 1e-8) <= (dur / expected_dur) < 1.5
55+
assert (1 - 1e-8) <= (dur / expected_dur) < 2.0
5656

5757
return result.unwrap()
5858

0 commit comments

Comments
 (0)