Skip to content

Commit

Permalink
Fix flaky test_task_counter
Browse files Browse the repository at this point in the history
  • Loading branch information
crusaderky committed Aug 24, 2023
1 parent 22eb33a commit 0acd0f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions distributed/tests/test_worker_state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1748,8 +1748,9 @@ def assert_time(actual, expect):
# timer accuracy in Windows can be very poor;
# see awful hack in distributed.metrics
margin_lo = 0.099 if WINDOWS else 0
# sleep() has been observed to have up to 450ms lag on MacOSX GitHub CI
margin_hi = 0.6 if MACOS else 0.1
# sleep() has been observed to have up to 450ms lag on both
# MacOSX and Windows GitHub CI
margin_hi = 0.6 if MACOS or WINDOWS else 0.1
assert expect - margin_lo <= actual < expect + margin_hi

sleep(0.1)
Expand Down

0 comments on commit 0acd0f5

Please sign in to comment.