Skip to content

test(2467): derive the fleet-list fixture timestamp from now, not a literal date - #2497

Merged
vybe merged 1 commit into
devfrom
fix/2467-fleet-list-test-time-bomb
Sep 2, 2026
Merged

vybe merged 1 commit into
devfrom
fix/2467-fleet-list-test-time-bomb

Conversation

@trinity-ability

Copy link
Copy Markdown
Contributor

Refs #2467 (follow-up to #2473 — a test time bomb, not a product change).

What broke

dev's backend-unit-test push run went red on the #2471 merge (run 33634096378): one failure in 13,527,

FAILED unit/test_2467_turn_integrity.py::TestListReadersCarryTheColumn::test_fleet_list_returns_turn_integrity - assert 0 == 1

#2471 touches nothing under src/ or this test. The cause is the fixture: it inserts started_at = "2026-09-01T10:00:00Z" as a literal, and get_fleet_executions defaults to hours=24 (db/schedules/stats.py:338). So the row fell out of the window at 2026-09-02 10:00 UTC — the previous push (dd91056, 09:15 UTC) was green, and the same test fails on that commit today. The sibling get_agent_executions_summary reader has no window, which is why only one of the pair went red.

Fix

Both timestamps are derived from datetime.now(timezone.utc) in the utc_now_iso() shape the readers parse. A comment on the fixture names the trap so the next reader doesn't re-plant it.

Verification

  • tests/unit/test_2467_turn_integrity.py: 33 passed (run twice) on this branch; the single test fails deterministically on dev and on dd91056 without the change.
  • grep for other get_fleet_executions tests carrying a "2026- literal: this was the only one.

🤖 Generated with Claude Code

https://claude.ai/code/session_012d5K93m76zw4Rn193FXvsJ

…iteral date

`get_fleet_executions` defaults to `hours=24`. The `TestListReadersCarryTheColumn`
fixture inserted `started_at = "2026-09-01T10:00:00Z"`, so
`test_fleet_list_returns_turn_integrity` passed every run until 2026-09-02 10:00 UTC
and then failed every `dev` push after it — run 33634096378, `assert 0 == 1`, with
no code change anywhere. First seen on the #2471 merge; reproduced identically on
the pre-merge commit dd91056, so it is the fixture's clock, not a regression.

Both timestamps now come from `datetime.now(timezone.utc)`, in the `utc_now_iso()`
shape the readers parse. The sibling `get_agent_executions_summary` test never
windowed, which is why only one of the two went red.

Refs #2467

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_012d5K93m76zw4Rn193FXvsJ

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified: the single test fails deterministically on dev and on dd91056 today, passes with the relative timestamp (33/33 in the file, run twice). Test-only diff. Approving; merging once backend-unit-test is green, not just the required contexts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants