TestAutoExecFinalizesDead: a runner error (or a session that never marks itself done) finalizes as 'dead'.
(t *testing.T)
| 234 | // TestAutoExecFinalizesDead: a runner error (or a session that never marks |
| 235 | // itself done) finalizes as 'dead'. |
| 236 | func TestAutoExecFinalizesDead(t *testing.T) { |
| 237 | setupFlowRoot(t) |
| 238 | seedTask(t, "auto-task") |
| 239 | seedRunningAuto(t, "auto-task", 4242) |
| 240 | |
| 241 | stubAutoRunner(t, func(h harness.Harness, sessionID, prompt string, opts harness.LaunchOpts) error { |
| 242 | return errors.New("harness exploded") |
| 243 | }) |
| 244 | |
| 245 | if rc := cmdAutoExec([]string{"auto-task"}); rc != 1 { |
| 246 | t.Fatalf("cmdAutoExec rc=%d, want 1 on runner error", rc) |
| 247 | } |
| 248 | db := openFlowDB(t) |
| 249 | task, err := flowdb.GetTask(db, "auto-task") |
| 250 | if err != nil { |
| 251 | t.Fatal(err) |
| 252 | } |
| 253 | if task.AutoRunStatus.String != "dead" { |
| 254 | t.Errorf("auto_run_status = %q, want dead", task.AutoRunStatus.String) |
| 255 | } |
| 256 | if !task.AutoRunFinished.Valid { |
| 257 | t.Error("auto_run_finished should be set even for dead runs") |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | // TestReconcileAutoRunDeadPid: a 'running' row whose supervisor pid is no |
| 262 | // longer alive is reconciled to 'dead' on read. |
nothing calls this directly
no test coverage detected