diff --git a/distributed/tests/test_scheduler.py b/distributed/tests/test_scheduler.py index 1e1a3e69b32..0021d039fed 100644 --- a/distributed/tests/test_scheduler.py +++ b/distributed/tests/test_scheduler.py @@ -3218,3 +3218,16 @@ async def test_set_restrictions(c, s, a, b): assert s.tasks[f.key].worker_restrictions == {a.address} s.reschedule(f) await f + + +@gen_cluster( + client=True, + nthreads=[("", 1, {}), ("", 1, {"memory_pause_fraction": 1e-15}), ("", 1, {})], +) +async def test_avoid_paused_workers(c, s, w1, w2, w3): + while s.workers[w2.address].status != Status.paused: + await asyncio.sleep(0.01) + futures = c.map(slowinc, range(8), delay=0.1) + w1: Worker + while (len(w1.tasks), len(w2.tasks), len(w3.tasks)) != (4, 0, 4): + await asyncio.sleep(0.01)