From a1b41020cffb296ccabb4f28b6bb4e3509e504b5 Mon Sep 17 00:00:00 2001 From: Shankar Date: Wed, 25 Mar 2026 20:55:48 -0400 Subject: [PATCH] fix: resolve flaky TestGetJobStats_WithData timezone issue CompletedAt was set to Now()-1h which falls on "yesterday" when CI runs near midnight UTC, causing the date bucket lookup to miss. Use Now() directly since the test only needs jobs completed "today". Co-Authored-By: Claude Opus 4.6 --- internal/service/stats_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/stats_test.go b/internal/service/stats_test.go index 28cec20..0a6f599 100644 --- a/internal/service/stats_test.go +++ b/internal/service/stats_test.go @@ -187,7 +187,7 @@ func TestGetJobStats_Empty(t *testing.T) { func TestGetJobStats_WithData(t *testing.T) { svc, _, jobRepo, _ := newTestStatsService() - completedAt := time.Now().Add(-1 * time.Hour) + completedAt := time.Now() jobRepo.AddJob(&domain.Job{ID: "j-1", Status: domain.JobStatusCompleted, CompletedAt: &completedAt}) jobRepo.AddJob(&domain.Job{ID: "j-2", Status: domain.JobStatusFailed, CompletedAt: &completedAt})