From 80f8e2edc4a2a0cc95d54c892dffce6fae61dbae Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Sun, 18 Oct 2026 23:43:58 +0100 Subject: [PATCH] Wait for released workspace cleanup in retry isolation test --- internal/server/concurrency_test.go | 3 +++ 1 file changed, 3 insertions(+) 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)