Skip to content

Commit

Permalink
Fix flaky test_gather_dep_one_worker_always_busy (#6554)
Browse files Browse the repository at this point in the history
  • Loading branch information
crusaderky authored Jun 10, 2022
1 parent 059798a commit 6272e20
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions distributed/tests/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1939,6 +1939,7 @@ def f(x):
assert not C.instances


@pytest.mark.slow
@gen_cluster(client=True)
async def test_gather_dep_one_worker_always_busy(c, s, a, b):
# Ensure that both dependencies for H are on another worker than H itself.
Expand Down Expand Up @@ -1966,12 +1967,14 @@ async def test_gather_dep_one_worker_always_busy(c, s, a, b):
assert b.tasks[g.key].state in ("flight", "fetch")

with pytest.raises(asyncio.TimeoutError):
await h.result(timeout=0.5)
await h.result(timeout=0.8)

story = b.story("busy-gather")
# 1 busy response straight away, followed by 1 retry every 150ms for 500ms.
# 1 busy response straight away, followed by 1 retry every 150ms for 800ms.
# The requests for b and g are clustered together in single messages.
assert 3 <= len(story) <= 7
# We need to be very lax in measuring as PeriodicCallback+network comms have been
# observed on CI to occasionally lag behind by several hundreds of ms.
assert 2 <= len(story) <= 8

async with Worker(s.address, name="x") as x:
# We "scatter" the data to another worker which is able to serve this data.
Expand Down

0 comments on commit 6272e20

Please sign in to comment.