diff --git a/internal/server/concurrency_test.go b/internal/server/concurrency_test.go index 81aa2236..a60bf7e7 100644 --- a/internal/server/concurrency_test.go +++ b/internal/server/concurrency_test.go @@ -370,6 +370,9 @@ func TestRetryConflictsOnlyWithSameWorkspaceActiveRun(t *testing.T) { t.Fatalf("retry did not conflict with same-workspace active run: %v", err) } close(releaseA) + // Execution returning does not instantly remove the workspace reservation. + // Finish A's cleanup before asserting that only the unrelated B is active. + r.wg.Wait() // A different active workspace must not block the retry of the original. if _, err := r.start(protocol.Message{PipelineID: pipelineID, Version: 1, RequestKey: "active-b", Workspace: b, Input: map[string]any{"prompt": "task"}}); err != nil { t.Fatal(err)