fix: stop the evidence API test's clock from rotting #1719

Merged
binjovi-bot merged 1 commit from fix/evidence-api-test-clock-drift into trunk 2026-09-13 10:38:53 +00:00
Owner

Summary

evidence_api_test.exs seeded its Release/Deploy fixtures at a fixed
past date, ~U[2026-09-08 10:00:00Z]. Unlike every sibling test file,
this one has no clock to override: the endpoint it exercises calls
Activity.snapshot/1 with no opts, so it always reads a real
DateTime.utc_now/0 for its 5-day rolling activity window. Once the
fixed seed date fell more than 5 days behind actual wall-clock time,
the endpoint silently dropped the seeded record and the
target["deployment_id"] assertion started failing with nil.

This currently blocks make test-api-unit, which blocks every release
for this project — found while releasing an unrelated PR (#1718),
confirmed independent of that PR's changes by reproducing it against
unmodified trunk via git stash.

Anchoring the seed timestamp to DateTime.utc_now() instead fixes it
for good, matching the pattern already used elsewhere in this suite.

Test plan

  • mix test apps/binjovi_api/test/evidence_api_test.exs — 3/3 pass
  • make check (full local equivalent, including postgres) — green

https://claude.ai/code/session_01JGe4pyhQ36AhgDfPJry4d3

## Summary `evidence_api_test.exs` seeded its Release/Deploy fixtures at a fixed past date, `~U[2026-09-08 10:00:00Z]`. Unlike every sibling test file, this one has no clock to override: the endpoint it exercises calls `Activity.snapshot/1` with no opts, so it always reads a real `DateTime.utc_now/0` for its 5-day rolling activity window. Once the fixed seed date fell more than 5 days behind actual wall-clock time, the endpoint silently dropped the seeded record and the `target["deployment_id"]` assertion started failing with `nil`. This currently blocks `make test-api-unit`, which blocks every release for this project — found while releasing an unrelated PR (#1718), confirmed independent of that PR's changes by reproducing it against unmodified trunk via `git stash`. Anchoring the seed timestamp to `DateTime.utc_now()` instead fixes it for good, matching the pattern already used elsewhere in this suite. ## Test plan - [x] `mix test apps/binjovi_api/test/evidence_api_test.exs` — 3/3 pass - [x] `make check` (full local equivalent, including postgres) — green https://claude.ai/code/session_01JGe4pyhQ36AhgDfPJry4d3
fix(api): stop the evidence API test's clock from rotting
All checks were successful
binjovi/ci Binjovi completed the frozen plan
935311c445
evidence_api_test.exs seeded its Release/Deploy fixtures at a fixed
past date, ~U[2026-09-08 10:00:00Z]. Unlike every sibling test file,
this one has no clock to override: the endpoint it exercises calls
Activity.snapshot/1 with no opts, so it always reads a real
DateTime.utc_now/0 for its 5-day rolling activity window. Once the
fixed seed date fell more than 5 days behind actual wall-clock time,
the endpoint silently dropped the seeded record and the test's
target["deployment_id"] assertion started failing.

This blocked the whole build (make test-api-unit), which blocks every
release for the project -- confirmed independent of this PR's changes
by reproducing it against unmodified trunk. Anchoring the seed
timestamp to DateTime.utc_now() instead fixes it for good.

Claude-Session: https://claude.ai/code/session_01JGe4pyhQ36AhgDfPJry4d3
binjovi-bot deleted branch fix/evidence-api-test-clock-drift 2026-09-13 10:38:53 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sean/binjovi!1719
No description provided.