Skip to content

test(wayback): pin the per-app route tests to the archive floor, not the calendar - #395

Merged
AdamXweb merged 1 commit into
mainfrom
fix/date-independent-import-route-tests
Oct 16, 2026
Merged

AdamXweb merged 1 commit into
mainfrom
fix/date-independent-import-route-tests

Conversation

@adamXbot

Copy link
Copy Markdown
Collaborator

What and why

The Docker publish run on e6243d9 (#394's merge) failed in quality on one unit test, tests/app/historical-import-chain.test.ts "the per-app route accepts force and records it": imported was 0, not 1. #394 is not the cause: the same test fails at d2cff0a and 940a8c6 today, and #394's own PR CI passed on the identical tree a day earlier.

The test depends on the calendar. The two per-app route tests cannot pass today to the importer, so their quarterly target grid is anchored on the wall clock, stepping back from the current date in whole months (computeHistoricalTargets). Their mocked capture is dated 2021-06-01. With the real computeHistoricalTargets:

  • on 2026-10-15 the nearest target is 44.2 days from that capture: imported;
  • on 2026-10-16 it is 45.4 days away, past the 45-day drift tolerance: skipped_drift, so imported is 0.

Across the next 120 days the test fails on exactly two of them (16 Oct, 16 Jan), which is why it has never failed in a PR before and why it will fail again every few months, on main and in the release's Docker job alike.

The fix is in the tests only: both route tests now mock a capture on the archive floor (2021-02-01). The floor is pushed as a target unconditionally, so a capture on it is never drift-skipped whatever the date. Nothing else in the file changes, and the importer and route are untouched.

How it was verified

  • The whole file passes on the real clock today (UTC 16 October, a failing day): 23 passed, 0 failed.
  • With Date pinned by a preload to 2026-10-15T05:17Z, 2026-10-16T14:50Z, 2027-01-16T12:00Z and 2026-11-30T23:59Z: 23 passed, 0 failed each time.
  • Control: the unfixed test file from e6243d9, pinned to 2026-10-16T14:50Z, reproduces the failure.
  • Biome: clean.

🤖 Generated with Claude Code

…the calendar

The two route tests cannot pass `today`, so their target grid steps back
from the wall clock in whole months. Their 2021-06-01 capture sat 44 days
from a target when the month's day was 15 and 45.4 days when it was 16,
past the 45-day drift tolerance, so `imported` was 0 on the 16th of some
months and the Docker publish on e6243d9 failed in `quality`. A capture
on the floor is always a target and never drift-skipped.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@adamXbot
adamXbot requested a review from AdamXweb as a code owner October 16, 2026 15:00
@AdamXweb
AdamXweb merged commit 93b2c8a into main Oct 16, 2026
17 checks passed
@AdamXweb
AdamXweb deleted the fix/date-independent-import-route-tests branch October 16, 2026 23:17
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