From b194071ca5149fd16d73408bc8bad177899c7833 Mon Sep 17 00:00:00 2001 From: stroblme Date: Tue, 25 Aug 2026 21:52:48 +0200 Subject: [PATCH] Pick the run this test made, not the first one running The suite runs in a random order and a run left marked running by an earlier module lands in the same list, so asserting on data[0] failed on whichever seed put that module first. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_013Gf7WaExcJ9bs3kfJXB3nK --- backend/tests/api/routes/test_observability.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/tests/api/routes/test_observability.py b/backend/tests/api/routes/test_observability.py index f67e8e2..29e0b45 100644 --- a/backend/tests/api/routes/test_observability.py +++ b/backend/tests/api/routes/test_observability.py @@ -278,7 +278,10 @@ def test_a_running_cascade_reports_how_long_it_has_been_going( f"{PREFIX}/runs", headers=superuser_token_headers, params={"status": "running"} ).json() - assert runs["data"][0]["duration_ms"] >= 30_000 + # By id rather than by position: another module can leave a run of its own + # still marked running, and the list is not this test's alone. + in_flight = next(r for r in runs["data"] if r["id"] == "in-flight") + assert in_flight["duration_ms"] >= 30_000 def test_events_narrow_to_one_minute(