From 74103cbdda45859bf8b40d40d7501740034b0097 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Thu, 9 Jul 2026 12:18:37 +0100 Subject: [PATCH] Fix flaky `test_many_Progress` --- distributed/diagnostics/tests/test_progress.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/distributed/diagnostics/tests/test_progress.py b/distributed/diagnostics/tests/test_progress.py index eaab6d0354..5e9ad3269a 100644 --- a/distributed/diagnostics/tests/test_progress.py +++ b/distributed/diagnostics/tests/test_progress.py @@ -40,14 +40,17 @@ def h(*args): @nodebug -@pytest.mark.flaky(reruns=10, reruns_delay=5) @gen_cluster(client=True) async def test_many_Progress(c, s, a, b): x = c.submit(f, 1) y = c.submit(g, x) z = c.submit(h, y) - bars = [Progress(keys=[z], scheduler=s) for _ in range(10)] + # Give each bar a unique name; otherwise they all tokenize to the same + # plugin name and clobber each other in Scheduler.plugins. If z is still + # processing when setup() runs (e.g. on slow CI), the second bar's + # add_plugin() would then warn "overwriting", which is raised as an error. + bars = [Progress(keys=[z], scheduler=s, name=f"progress-{i}") for i in range(10)] await asyncio.gather(*(bar.setup() for bar in bars)) await z