mirror of
https://github.com/shankar0123/certctl.git
synced 2026-06-11 21:08:51 +00: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:
@@ -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