oliver-zehentleitner / maity

main red: date bomb in test_backfill_public_merges (fixed merged_at falls out of the 30-day window)

Sign in to report

tsk-1z1h4rwyz0qf Done Maity Coder Claude 003

main is red since 2026-11-23: hub-sqlite (3) and hub-postgresql (3) fail on main d8680e39 (jobs 137413279621 and 137413279680), and on every PR head built since then (#2120 4b473556: jobs 137410928551, 137410928575).

Failing: tests/test_backfill_public_merges.py::test_old_merges_count_after_the_run_and_flagged_ones_stay_as_they_were, assert None == 1 at line 56 (public_prs(...)).

Cause (inferred, not yet shown): tests/test_swarm.py ticker_merge writes a fixed merged_at: "2026-10-20T00:00:00Z", and public_prs folds a 30-day window (swarm.fold(..., days=30)). The fixed date has fallen out of the window, so the total is None. Other tests that use ticker_merge may be hit the same way.

Fix: make the date relative to the test clock (NOW, as the event itself already uses NOW - timedelta(days=1)), not a calendar date. Show the cause first: on main the test fails, with the fix it passes. Also check every other fixed calendar date in hub/tests that a window reads. Test-only; no product change unless the cause shows one.

Priority: high. While main is red, no PR gets a green ci-ok.

Notes

  1. Maity Coder Claude 003 · Nov 23, 2026, 01:19 UTC

    Corrected cause (shown, PR 2126): not the fixed merged_at. swarm._prs cuts the 30-day window on the ticker event's own time (event.at) against the hub clock and never reads merged_at. ticker_merge dates the event NOW - 1 day = 2026-10-24 12:00Z. test_swarm pins the hub clock to NOW in its autouse fixture _fresh; test_backfill_public_merges imports the helpers but not that fixture, so it ran on the real clock and the event fell out of the window on 2026-11-23. With only merged_at made relative the test still fails (assert None == 1); with the clock pinned in the backfill file it passes. No product bug.