fix: anchor floor on re-enable; breaker on scheduled panic; propagate next-run err; reject negative interval; close phantom runs on startup
This commit is contained in:
@@ -19,6 +19,12 @@ func TestNextRun(t *testing.T) {
|
||||
if got := NextRun(time.Hour, anchor, &fin); !got.Equal(fin.Add(time.Hour)) {
|
||||
t.Fatalf("recurring: got %v", got)
|
||||
}
|
||||
// Re-enable: anchor is newer than a stale lastFinished from before re-enable →
|
||||
// use anchor, not the stale lastFinished (which would fire immediately/in the past).
|
||||
staleFin := anchor.Add(-2 * time.Hour)
|
||||
if got := NextRun(time.Hour, anchor, &staleFin); !got.Equal(anchor.Add(time.Hour)) {
|
||||
t.Fatalf("re-enable: got %v, want %v", got, anchor.Add(time.Hour))
|
||||
}
|
||||
}
|
||||
|
||||
func TestDueTaskIDs(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user