diff --git a/t/Pyjo/Steps.py b/t/Pyjo/Steps.py index db65057b..e79f099e 100644 --- a/t/Pyjo/Steps.py +++ b/t/Pyjo/Steps.py @@ -167,7 +167,9 @@ async def nap(seconds): Pyjo.IOLoop.remove(timer) value, slept = result['value'] is_ok(value, None, 'nothing, non-blocking') - ok(slept >= 0.2, 'slept, non-blocking') + # A timer of an event loop on libuv, as the ones of uvloop and gevent, counts whole milliseconds of a clock that + # libuv rounds down, so it may be due up to a millisecond early by time.monotonic + ok(slept >= 0.19, 'slept, non-blocking') ok(len(ticks) >= 3, 'other events meanwhile') async def retried(): diff --git a/t/docs/Steps.py b/t/docs/Steps.py index 38aa70ad..7dd29019 100644 --- a/t/docs/Steps.py +++ b/t/docs/Steps.py @@ -117,7 +117,9 @@ async def sleeps(): ok(Steps(sleeps()).run(ua) >= 0.6, 'sleeps, blocking') result = [] Pyjo.Steps.new(sleeps()).run_p(ua).then(result.append).wait() - ok(result[0] >= 0.6, 'sleeps, non-blocking') + # A timer of an event loop on libuv, as the ones of uvloop and gevent, counts whole milliseconds of a clock that + # libuv rounds down, so each one may be due up to a millisecond early by time.monotonic + ok(result[0] >= 0.59, 'sleeps, non-blocking') with subtest('Steps'):