From 8836d3281043389e431edf1882941d7169e60350 Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Sun, 8 Nov 2026 07:39:28 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20test:=20load=20the=20reloaded=20?= =?UTF-8?q?sweep=20ledger=20with=20the=20test=20clock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TestCloseOnMergeLedgerSweepSettledClaimsSkipAPI reloaded the ledger via LoadClaimLedger, which prunes settled claims past settledClaimRetention against the wall clock before SetClock could take effect. The fixture's claims settled on 2026-10-09, so the test started failing on every branch 30 days later. Use loadClaimLedgerAt with the test clock, as the other retention tests already do. Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- src/pkg/github/close_on_merge_ledger_sweep_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pkg/github/close_on_merge_ledger_sweep_test.go b/src/pkg/github/close_on_merge_ledger_sweep_test.go index cce25bb516..bdd1592b6d 100644 --- a/src/pkg/github/close_on_merge_ledger_sweep_test.go +++ b/src/pkg/github/close_on_merge_ledger_sweep_test.go @@ -177,12 +177,14 @@ func TestCloseOnMergeLedgerSweepSettledClaimsSkipAPI(t *testing.T) { } } - // The marker is persisted: a reloaded ledger skips too. - reloaded, err := LoadClaimLedger(ledger.path, nil) + // The marker is persisted: a reloaded ledger skips too. Load with the + // test clock: LoadClaimLedger prunes settled claims past + // settledClaimRetention against the wall clock, so a fixed fixture date + // would otherwise expire the claims once the calendar moves on. + reloaded, err := loadClaimLedgerAt(ledger.path, nil, func() time.Time { return now }) if err != nil { t.Fatal(err) } - reloaded.SetClock(func() time.Time { return now }) fourth := c.CloseOnMergeLedgerSweep(context.Background(), reloaded, opts) if fourth.SkippedSettled != 3 || len(fourth.Results) != 0 { t.Fatalf("reloaded sweep = %+v, want 3 settled skips", fourth)