Skip to content

Commit

Permalink
fix(BackupSchedule): cron schedule unit test timing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ravi-shankar-sap committed Feb 4, 2025
1 parent 7cbb9fd commit aa7707f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/skr/backupschedule/calculateRecurringSchedule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,10 @@ func (suite *calculateRecurringScheduleSuite) testSchedule(schedule string, star
suite.Nil(err)
suite.Equal(len(expectedRunTimes), len(fromK8s.Status.NextRunTimes))

for i, t := range expectedRunTimes {
suite.Equal(t.Format(time.RFC3339), fromK8s.Status.NextRunTimes[i])
for i, expected := range expectedRunTimes {
actual, err := time.Parse(time.RFC3339, fromK8s.Status.NextRunTimes[i])
suite.Nil(err)
suite.WithinDuration(expected, actual, time.Minute*1)
}
}

Expand Down

0 comments on commit aa7707f

Please sign in to comment.