Skip to content

Commit

Permalink
Fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
crusaderky committed Apr 17, 2020
1 parent be67523 commit 3e8ce43
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions distributed/tests/test_steal.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,9 @@ async def test_worksteal_many_thieves(c, s, *workers):

@gen_cluster(client=True, nthreads=[("127.0.0.1", 1)] * 2)
async def test_dont_steal_unknown_functions(c, s, a, b):
futures = c.map(inc, [1, 2], workers=a.address, allow_other_workers=True)
futures = c.map(inc, range(100), workers=a.address, allow_other_workers=True)
await wait(futures)
assert len(a.data) == 2, [len(a.data), len(b.data)]
assert len(b.data) == 0, [len(a.data), len(b.data)]
assert len(a.data) >= 95, [len(a.data), len(b.data)]


@gen_cluster(client=True, nthreads=[("127.0.0.1", 1)] * 2)
Expand All @@ -120,8 +119,8 @@ async def test_eventually_steal_unknown_functions(c, s, a, b):
slowinc, range(10), delay=0.1, workers=a.address, allow_other_workers=True
)
await wait(futures)
assert len(a.data) >= 3
assert len(b.data) >= 3
assert len(a.data) >= 3, [len(a.data), len(b.data)]
assert len(b.data) >= 3, [len(a.data), len(b.data)]


@pytest.mark.skip(reason="")
Expand Down

0 comments on commit 3e8ce43

Please sign in to comment.