summaryrefslogtreecommitdiff
path: root/internal/executor/executor_test.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-04-10 09:17:31 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-05-03 17:59:18 +0000
commitf01231cc45f41ce2dc37072e77428e467ef3fc15 (patch)
treeed850c116148d86876ed43d0d7598094052c4b18 /internal/executor/executor_test.go
parent2196a048b1a980ff6a4d04918cbee69778186c83 (diff)
fix: atomic execution creation + RUNNING state transition
Add CreateExecutionAndSetRunning to storage.DB and Store interface, replacing the two sequential CreateExecution/UpdateTaskState calls in executor.go. Eliminates the crash window where a task stays PENDING with an orphaned RUNNING execution record. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/executor/executor_test.go')
-rw-r--r--internal/executor/executor_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/executor/executor_test.go b/internal/executor/executor_test.go
index cb8205d..fac7e9c 100644
--- a/internal/executor/executor_test.go
+++ b/internal/executor/executor_test.go
@@ -1134,7 +1134,10 @@ func (m *minimalMockStore) ListSubtasks(parentID string) ([]*task.Task, error) {
return nil, nil
}
func (m *minimalMockStore) ListExecutions(_ string) ([]*storage.Execution, error) { return nil, nil }
-func (m *minimalMockStore) CreateExecution(e *storage.Execution) error { return nil }
+func (m *minimalMockStore) CreateExecution(e *storage.Execution) error { return nil }
+func (m *minimalMockStore) CreateExecutionAndSetRunning(e *storage.Execution) error {
+ return nil
+}
func (m *minimalMockStore) UpdateExecution(e *storage.Execution) error {
return m.updateExecErr
}