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.
This commit is contained in:
2026-08-25 21:52:48 +02:00
parent cdb1bffdd4
commit 7fe6a0f703
@@ -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(