Fix flaky test_close_gracefully and test_lifetime#5677
Conversation
| futures = c.map(slowinc, range(200), delay=0.1, worker=[b.address]) | ||
| await asyncio.sleep(1.5) | ||
| assert b.status not in (Status.running, Status.paused) | ||
| futures = c.map(slowinc, range(200), delay=0.1, workers=[b.address]) |
There was a problem hiding this comment.
fix spelling error worker->workers! All tasks were failing before!
There was a problem hiding this comment.
something like await next(as_completed(futures)) would protect us there and may remove the necessity for sleep below. I'm fine without it
| async with Worker(s.address) as a, Worker(s.address, lifetime="2 seconds") as b: | ||
| futures = c.map(slowinc, range(200), delay=0.1, workers=[b.address]) | ||
| await asyncio.sleep(1) | ||
| assert not a.data |
There was a problem hiding this comment.
After fixing the misspelling above, the test was occasionally failing this assertion with lifetime="1 seconds" and sleep(0.5)
|
All test failures are unrelated; ready for review and merge |
distributed/tests/test_worker.py
Outdated
| proc = {ts for ts in b.tasks.values() if ts.state == "executing"} | ||
| assert proc | ||
|
|
||
| assert any(ts for ts in b.tasks.values() if ts.state == "executing") |
There was a problem hiding this comment.
I think there is a tiny time window possible where no task is in executing state until the next ensure_computing is called
| a.story(key), | ||
| [ | ||
| (key, "put-in-memory"), | ||
| (key, "receive-from-scatter"), |
There was a problem hiding this comment.
legacy (pre-AMM) Scheduler.gather_on_worker, which underlies both Scheduler.replicate and Scheduler.retire_workers
| futures = c.map(slowinc, range(200), delay=0.1, worker=[b.address]) | ||
| await asyncio.sleep(1.5) | ||
| assert b.status not in (Status.running, Status.paused) | ||
| futures = c.map(slowinc, range(200), delay=0.1, workers=[b.address]) |
There was a problem hiding this comment.
something like await next(as_completed(futures)) would protect us there and may remove the necessity for sleep below. I'm fine without it
|
All review comments have been incorporated. |
commit 14bddba1482de035ca416368f918d94b115d3660 Merge: df079fc 9a66b71 Author: crusaderky <crusaderky@gmail.com> Date: Tue Jan 25 17:16:58 2022 +0000 Merge branch 'main' into AMM/RetireWorker commit df079fc Merge: 9676934 5835ce3 Author: crusaderky <crusaderky@gmail.com> Date: Mon Jan 24 15:08:51 2022 +0000 Merge branch 'AMM/staging' into AMM/RetireWorker commit 5835ce3 Merge: ee68b02 b0b8e95 Author: crusaderky <crusaderky@gmail.com> Date: Mon Jan 24 15:07:27 2022 +0000 Merge branch 'AMM/test_close_gracefully' into AMM/staging commit ee68b02 Merge: 7d4e6ee ccad288 Author: crusaderky <crusaderky@gmail.com> Date: Mon Jan 24 15:06:50 2022 +0000 Merge branch 'main' into AMM/staging commit b0b8e95 Author: crusaderky <crusaderky@gmail.com> Date: Mon Jan 24 14:32:29 2022 +0000 Code review commit 9676934 Author: crusaderky <crusaderky@gmail.com> Date: Fri Jan 21 14:50:53 2022 +0000 AMM to manage retire_workers() commit 7d4e6ee Author: crusaderky <crusaderky@gmail.com> Date: Fri Jan 21 14:39:41 2022 +0000 Fix flaky test_close_gracefully and test_lifetime (dask#5677) commit 7faab51 Author: crusaderky <crusaderky@gmail.com> Date: Fri Jan 21 14:39:41 2022 +0000 harden test commit aef3b71 Author: crusaderky <crusaderky@gmail.com> Date: Fri Jan 21 14:29:10 2022 +0000 Increase resilience on slow CI commit af84e40 Author: crusaderky <crusaderky@gmail.com> Date: Fri Jan 21 12:39:18 2022 +0000 Dump cluster state on all test failures (dask#5674) commit 5054c19 Author: crusaderky <crusaderky@gmail.com> Date: Fri Jan 21 12:38:38 2022 +0000 Paused workers shouldn't steal tasks (dask#5665) commit eadb35f Author: crusaderky <crusaderky@gmail.com> Date: Fri Jan 21 12:37:48 2022 +0000 transition flight to missing if no who_has (dask#5653) commit 581aee8 Merge: 940bb45 60c0d60 Author: crusaderky <crusaderky@gmail.com> Date: Fri Jan 21 12:36:09 2022 +0000 Merge branch 'main' into AMM/test_close_gracefully commit 940bb45 Author: crusaderky <crusaderky@gmail.com> Date: Fri Jan 21 12:20:10 2022 +0000 tweak comment commit 731d132 Author: crusaderky <crusaderky@gmail.com> Date: Fri Jan 21 12:12:03 2022 +0000 Fix flaky test_close_gracefully and test_lifetime
Closes #4862