Skip to content

Commit

Permalink
test_avoid_paused_workers
Browse files Browse the repository at this point in the history
  • Loading branch information
crusaderky committed Oct 18, 2021
1 parent d704c6e commit 5be5309
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions distributed/tests/test_scheduler.py
Expand Up @@ -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)

0 comments on commit 5be5309

Please sign in to comment.