Scheduler: skip unreadable schedules, admit claimed runs asynchronously
A schedule that cannot be parsed or claimed is logged and skipped instead of aborting the tick for every schedule. Claimed runs are admitted on their own goroutines, so a slow start (worktree creation) no longer makes the next due schedule look missed; lateness is measured at claim time. An invalid interval no longer divides by zero. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -73,6 +73,7 @@ func TestScheduledRunPreservesWriteScopeAndWorkflowPermissions(t *testing.T) {
|
||||
if err = r.scheduleTick(dueOf(t, entry), false); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
r.scheduleAdmissions.Wait()
|
||||
r.wg.Wait()
|
||||
runs, err := s.ListRuns(ctx)
|
||||
if err != nil || len(runs) != 1 || runs[0].Status != "succeeded" || calls != 1 {
|
||||
@@ -111,6 +112,7 @@ func TestScheduleRechecksWriteScopeBeforeTitleOrExecution(t *testing.T) {
|
||||
if err = r.scheduleTick(dueOf(t, entry), false); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
r.scheduleAdmissions.Wait()
|
||||
r.wg.Wait()
|
||||
// The exact same shared policy rejects manual admission as well.
|
||||
if _, err = r.start(protocol.Message{PipelineID: pid, Version: 1, Workspace: workspace, Input: spec.Input, WritePaths: spec.WritePaths, AllowTools: true, RequestKey: "manual-unsafe"}); err == nil {
|
||||
|
||||
Reference in New Issue
Block a user