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 <noreply@anthropic.com>
This commit is contained in:
shankar0123
2026-03-25 20:55:48 -04:00
parent 4092bdfb1a
commit 29b55bfd01
+1 -1
View File
@@ -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})