Skip to content

Commit

Permalink
Fix flaky test
Browse files Browse the repository at this point in the history
Trivial
  • Loading branch information
crusaderky committed Apr 17, 2020
1 parent be67523 commit f198db7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion distributed/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2296,7 +2296,7 @@ async def test_cancel_collection(c, s, a, b):
start = time()
while s.tasks:
assert time() < start + 1
await time.sleep(0.01)
await asyncio.sleep(0.01)


def test_cancel(c):
Expand Down
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 f198db7

Please sign in to comment.