test(server/m7-recurring-scans): TZ-tolerant next-fire assertion

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.
This commit is contained in:
2026-05-06 22:59:23 -04:00
parent 6a2697518f
commit 837db5c929
+6 -2
View File
@@ -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)
}
}
}