Skip to content

Commit 4182308

Browse files
authored
Bug: dashboard would not show no-worker tasks (#9215)
1 parent 053db38 commit 4182308

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

distributed/dashboard/components/scheduler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3343,7 +3343,7 @@ def update(self):
33433343

33443344
for tp in self.scheduler.task_prefixes.values():
33453345
states = tp.states
3346-
if any(states.get(s) for s in state.keys()):
3346+
if any(v for k, v in states.items() if k != "forgotten"):
33473347
state["memory"][tp.name] = states["memory"]
33483348
state["erred"][tp.name] = states["erred"]
33493349
state["released"][tp.name] = states["released"]

distributed/dashboard/tests/test_scheduler_bokeh.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,30 @@ async def test_TaskProgress_empty(c, s, a, b):
287287
assert not any(len(v) for v in tp.source.data.values())
288288

289289

290+
@gen_cluster(client=True)
291+
async def test_TaskProgress_no_worker(c, s, a, b):
292+
"""The no-worker state has special treatment as dashes cause issues in Bokeh"""
293+
tp = TaskProgress(s)
294+
295+
future = c.submit(slowinc, 0, resources={"foo": 1})
296+
while not s.tasks:
297+
await asyncio.sleep(0.01)
298+
299+
tp.update()
300+
assert tp.source.data["all"] == [1]
301+
assert tp.source.data["no_worker"] == [1]
302+
assert tp.source.data["name"] == ["slowinc"]
303+
304+
del future
305+
while s.tasks:
306+
await asyncio.sleep(0.01)
307+
308+
tp.update()
309+
assert tp.source.data["all"] == []
310+
assert tp.source.data["no_worker"] == []
311+
assert tp.source.data["name"] == []
312+
313+
290314
@gen_cluster(client=True)
291315
async def test_CurrentLoad(c, s, a, b):
292316
cl = CurrentLoad(s)

0 commit comments

Comments
 (0)