Skip to content

Commit

Permalink
fixup test
Browse files Browse the repository at this point in the history
  • Loading branch information
mrocklin committed Mar 23, 2022
1 parent 8fa8c46 commit d9ebab2
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions distributed/tests/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3320,19 +3320,8 @@ async def test_tick_interval(c, s, a, b):

await a.heartbeat()
x = s.workers[a.address].metrics["event_loop_interval"]
assert x
assert 0.0001 < x < 1
old = a._tick_interval_observed

old_count_last = a._tick_count_last

time.sleep(0.500) # Block event loop

while a._tick_count_last == old_count_last:
while s.workers[a.address].metrics["event_loop_interval"] > 0.050:
await asyncio.sleep(0.01)

await a.heartbeat()
y = s.workers[a.address].metrics["event_loop_interval"]
new = a._tick_interval_observed

assert y > x
while s.workers[a.address].metrics["event_loop_interval"] < 0.100:
await asyncio.sleep(0.01)
time.sleep(0.200)

0 comments on commit d9ebab2

Please sign in to comment.