From 837db5c929ff5541428d2c43a47d1dc0582bb37c Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 6 May 2026 22:59:23 -0400 Subject: [PATCH] test(server/m7-recurring-scans): TZ-tolerant next-fire assertion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PATCH-daily test parsed the wire RFC3339 timestamp and asserted .UTC().Hour() == 3, but the handler computes NextFire against time.Now() in the host zone before serializing as UTC — so non-UTC runners would see a non-3 UTC hour. Switch the assertion to .Local().Hour() to match the handler's computation regardless of the runner's TZ. --- internal/api/admin_scan_schedule_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/api/admin_scan_schedule_test.go b/internal/api/admin_scan_schedule_test.go index 09f5aff8..bb648d1e 100644 --- a/internal/api/admin_scan_schedule_test.go +++ b/internal/api/admin_scan_schedule_test.go @@ -91,8 +91,12 @@ func TestAdminScanSchedule_Patch_DailyMode(t *testing.T) { next, err := time.Parse(time.RFC3339, *resp.NextScheduledAt) if err != nil { t.Errorf("NextScheduledAt parse: %v", err) - } else if next.UTC().Hour() != 3 || next.UTC().Minute() != 0 { - t.Errorf("NextScheduledAt time = %v, want 03:00 UTC in some day", next) + } else if local := next.Local(); local.Hour() != 3 || local.Minute() != 0 { + // Handler computes next-fire from time.Now() in the host zone, so + // the local-time hour is what's stable across CI runners regardless + // of TZ; the wire timestamp is UTC but parses back to the same + // instant either way. + t.Errorf("NextScheduledAt local time = %v, want 03:00 in host zone", local) } } }