mirror of
https://github.com/certctl-io/certctl.git
synced 2026-09-25 10:19:03 +02:00
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:
co-authored by
Claude Opus 4.6
parent
de0ce72587
commit
a1b41020cf
@@ -187,7 +187,7 @@ func TestGetJobStats_Empty(t *testing.T) {
|
|||||||
|
|
||||||
func TestGetJobStats_WithData(t *testing.T) {
|
func TestGetJobStats_WithData(t *testing.T) {
|
||||||
svc, _, jobRepo, _ := newTestStatsService()
|
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-1", Status: domain.JobStatusCompleted, CompletedAt: &completedAt})
|
||||||
jobRepo.AddJob(&domain.Job{ID: "j-2", Status: domain.JobStatusFailed, CompletedAt: &completedAt})
|
jobRepo.AddJob(&domain.Job{ID: "j-2", Status: domain.JobStatusFailed, CompletedAt: &completedAt})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user