From 117b6c7fb49425fedcab08fb6dd0d88c47d720a7 Mon Sep 17 00:00:00 2001 From: yetone Date: Wed, 7 Oct 2026 00:16:14 +0800 Subject: [PATCH] usage tests: TestReasoningReplyTimedByItsAnswer's timeline rows are made now, as LedgerSeries buckets today by the clock The test gave LedgerSeries records dated 2026-10-06 14:30 UTC while LedgerSeries reads today from time.Now(), so it passed only on 2026-10-06 and has failed on every machine since ("part: {Calls:0 ...}" just after midnight CST on 10-07). The summary and row checks keep the fixed date; the rows given to LedgerSeries take the clock's. go test -race ./internal/usage passes; gofmt and vet are clean. --- internal/usage/usage_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/usage/usage_test.go b/internal/usage/usage_test.go index c1ea2a65..12bcd54f 100644 --- a/internal/usage/usage_test.go +++ b/internal/usage/usage_test.go @@ -235,6 +235,9 @@ func TestReasoningReplyTimedByItsAnswer(t *testing.T) { var lr []Row for _, r := range recs { rows.addRow(Row{Record: r}) + // LedgerSeries buckets today by the clock, so the timeline's rows + // are made now + r.Time = time.Now() lr = append(lr, Row{Record: r}) } if rows.Timed != 6 || rows.DecodeMs != ms || rows.DecodeOut != out {