Preserve leases needing recovery
This commit is contained in:
@@ -98,8 +98,8 @@ func TestPromptFailureRetainsLivePaneForBlockedTaskAcrossRestart(t *testing.T) {
|
||||
if err := c.Start(context.Background(), lease); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got, ok := s.Task(task.ID); !ok || got.State != domain.StateBlocked {
|
||||
t.Fatalf("task state = %+v, want blocked", got)
|
||||
if got, ok := s.Task(task.ID); !ok || got.State != domain.StateNeedsAttention || got.Lease == nil {
|
||||
t.Fatalf("task state = %+v, want needs_attention with retained lease", got)
|
||||
}
|
||||
if session, ok := c.Session(task.ID); !ok || session.PaneID != "pane-created-before-timeout" || session.HerdrID != "h1" {
|
||||
t.Fatalf("retained session = %+v, present=%v", session, ok)
|
||||
@@ -168,8 +168,8 @@ func TestCoordinatorRefusesRemoteHerdrOperations(t *testing.T) {
|
||||
if a.leases != 0 {
|
||||
t.Fatal("remote adapter was started by coordinator")
|
||||
}
|
||||
if task, ok := s.Task("remote"); !ok || task.State != domain.StateBlocked {
|
||||
t.Fatalf("remote task state = %#v, present=%v; want blocked", task, ok)
|
||||
if task, ok := s.Task("remote"); !ok || task.State != domain.StateNeedsAttention || task.Lease == nil {
|
||||
t.Fatalf("remote task state = %#v, present=%v; want needs_attention with retained lease", task, ok)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@ func TestTurnDecision(t *testing.T) {
|
||||
// TestStartBlocksOnInvalidPickup guards AUDIT.md's B6/Phase 4 item 4:
|
||||
// Coordinator.Start must run §6.2 pickup validation against the real
|
||||
// worktree before bootstrapping a successor onto a handoff_ref, and refuse
|
||||
// (TaskBlocked) rather than bootstrap on a mismatched anchor.
|
||||
// (TaskNeedsAttention) rather than bootstrap on a mismatched anchor.
|
||||
func TestStartBlocksOnInvalidPickup(t *testing.T) {
|
||||
repo := t.TempDir()
|
||||
run(t, repo, "init")
|
||||
@@ -476,8 +476,8 @@ func TestStartBlocksOnInvalidPickup(t *testing.T) {
|
||||
}
|
||||
|
||||
got, ok := s.Task(task.ID)
|
||||
if !ok || got.State != domain.StateBlocked {
|
||||
t.Fatalf("expected TaskBlocked on invalid pickup, got state=%v ok=%v", got.State, ok)
|
||||
if !ok || got.State != domain.StateNeedsAttention || got.Lease == nil {
|
||||
t.Fatalf("expected recoverable needs_attention on invalid pickup, got state=%v lease=%v ok=%v", got.State, got.Lease, ok)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user