From 3f64071a91b3876bb6bb4445fdd64ddc42bc67e3 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Thu, 26 Mar 2026 00:16:24 +0000 Subject: [PATCH 1/2] Bug: dashboard would not show no-worker tasks --- distributed/dashboard/components/scheduler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distributed/dashboard/components/scheduler.py b/distributed/dashboard/components/scheduler.py index 31224d5c12..506cec3c37 100644 --- a/distributed/dashboard/components/scheduler.py +++ b/distributed/dashboard/components/scheduler.py @@ -3343,7 +3343,7 @@ def update(self): for tp in self.scheduler.task_prefixes.values(): states = tp.states - if any(states.get(s) for s in state.keys()): + if any(v for k, v in states.items() if k != "forgotten"): state["memory"][tp.name] = states["memory"] state["erred"][tp.name] = states["erred"] state["released"][tp.name] = states["released"] From a35cdb6aa7b0821646a44d950856373c619d8a04 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Thu, 26 Mar 2026 00:29:56 +0000 Subject: [PATCH 2/2] Add test --- .../dashboard/tests/test_scheduler_bokeh.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/distributed/dashboard/tests/test_scheduler_bokeh.py b/distributed/dashboard/tests/test_scheduler_bokeh.py index e4ee7f1505..caeadeab69 100644 --- a/distributed/dashboard/tests/test_scheduler_bokeh.py +++ b/distributed/dashboard/tests/test_scheduler_bokeh.py @@ -287,6 +287,30 @@ async def test_TaskProgress_empty(c, s, a, b): assert not any(len(v) for v in tp.source.data.values()) +@gen_cluster(client=True) +async def test_TaskProgress_no_worker(c, s, a, b): + """The no-worker state has special treatment as dashes cause issues in Bokeh""" + tp = TaskProgress(s) + + future = c.submit(slowinc, 0, resources={"foo": 1}) + while not s.tasks: + await asyncio.sleep(0.01) + + tp.update() + assert tp.source.data["all"] == [1] + assert tp.source.data["no_worker"] == [1] + assert tp.source.data["name"] == ["slowinc"] + + del future + while s.tasks: + await asyncio.sleep(0.01) + + tp.update() + assert tp.source.data["all"] == [] + assert tp.source.data["no_worker"] == [] + assert tp.source.data["name"] == [] + + @gen_cluster(client=True) async def test_CurrentLoad(c, s, a, b): cl = CurrentLoad(s)