fix: stop the evidence API test's clock from rotting #1719
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/evidence-api-test-clock-drift"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
evidence_api_test.exsseeded its Release/Deploy fixtures at a fixedpast 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/1with no opts, so it always reads a realDateTime.utc_now/0for its 5-day rolling activity window. Once thefixed 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 withnil.This currently blocks
make test-api-unit, which blocks every releasefor 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 itfor good, matching the pattern already used elsewhere in this suite.
Test plan
mix test apps/binjovi_api/test/evidence_api_test.exs— 3/3 passmake check(full local equivalent, including postgres) — greenhttps://claude.ai/code/session_01JGe4pyhQ36AhgDfPJry4d3