fix: handle test case

This commit is contained in:
Barkhayot Juraev 2026-01-28 19:32:23 +09:00
parent 85cc5c7870
commit cb2774ecae
1 changed files with 3 additions and 5 deletions

View File

@ -630,12 +630,10 @@ func TestJob_NextRuns(t *testing.T) {
),
),
func(t *testing.T, iteration int, previousRun, nextRun time.Time) {
// With the fix for NextRun accuracy, the immediate run (Jan 1) is removed
// from nextScheduled after it completes. So all intervals should be 14 days
// (2 weeks as configured).
diff := time.Hour * 14 * 24
if iteration == 1 {
// because the job is run immediately, the first run is on
// Saturday 1/1/2000. The following run is then on Tuesday 1/11/2000
diff = time.Hour * 10 * 24
}
assert.Equal(t, previousRun.Add(diff).Day(), nextRun.Day())
},
},