Skip to content

Commit

Permalink
Avoid intermittent failure in test_cancel_fire_and_forget (#6131)
Browse files Browse the repository at this point in the history
It's possible that the cancel call actually comes before the tasks
arrive.  This is ok.  Dask actually handles it decently well, but our
checking of internal state in this test doesn't.  This change avoids
that case and avoids an intermittent failure.
  • Loading branch information
mrocklin authored Apr 15, 2022
1 parent 6daf3bf commit 68319f3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions distributed/tests/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,8 @@ async def test_cancel_fire_and_forget(c, s, a, b):
await asyncio.sleep(0.05)
await future.cancel(force=True)
assert future.status == "cancelled"
while s.tasks: # in rare conditions this can take a little while
await asyncio.sleep(0.01)
assert not s.tasks


Expand Down

0 comments on commit 68319f3

Please sign in to comment.