Report how long a run has been going, not just how long it took
Docs / docs (push) Successful in 20s
Playwright Tests / test-playwright (1, 2) (push) Failing after 2m39s
Playwright Tests / test-playwright (2, 2) (push) Failing after 1m39s
pre-commit / pre-commit (push) Failing after 2m51s
Playwright Tests / merge-reports (push) Canceled after 0s
Test Backend / test-backend (push) Canceled after 1m4s
Compose Smoke Test / test-compose (push) Canceled after 0s
Docs / docs (push) Successful in 20s
Playwright Tests / test-playwright (1, 2) (push) Failing after 2m39s
Playwright Tests / test-playwright (2, 2) (push) Failing after 1m39s
pre-commit / pre-commit (push) Failing after 2m51s
Playwright Tests / merge-reports (push) Canceled after 0s
Test Backend / test-backend (push) Canceled after 1m4s
Compose Smoke Test / test-compose (push) Canceled after 0s
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UytviPMJbXzD8P84nLvXcq
This commit is contained in:
@@ -266,6 +266,21 @@ def test_runs_narrow_to_one_minute(
|
||||
assert [run["id"] for run in runs["data"]] == ["minute-in"]
|
||||
|
||||
|
||||
def test_a_running_cascade_reports_how_long_it_has_been_going(
|
||||
client: TestClient, superuser_token_headers: dict[str, str], db: Session
|
||||
) -> None:
|
||||
"""The collector writes a duration at the end; until then, time since."""
|
||||
started = datetime.now(UTC) - timedelta(seconds=30)
|
||||
db.add(FlowRun(id="in-flight", flow=FLOW, started_at=started, status="running"))
|
||||
db.commit()
|
||||
|
||||
runs = client.get(
|
||||
f"{PREFIX}/runs", headers=superuser_token_headers, params={"status": "running"}
|
||||
).json()
|
||||
|
||||
assert runs["data"][0]["duration_ms"] >= 30_000
|
||||
|
||||
|
||||
def test_events_narrow_to_one_minute(
|
||||
client: TestClient, superuser_token_headers: dict[str, str], db: Session
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user