From a736cf30981bc2e9a1c7c72b4b6b39ee4057b47a Mon Sep 17 00:00:00 2001 From: mika kuns Date: Thu, 1 Oct 2026 13:31:26 +0200 Subject: [PATCH] test(worker): isolate GitRepoFixture repos under a unique parent so sibling worktree paths never collide Co-Authored-By: Claude Sonnet 5.5 --- .../Infrastructure/GitRepoFixture.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/ClaudeDo.Worker.Tests/Infrastructure/GitRepoFixture.cs b/tests/ClaudeDo.Worker.Tests/Infrastructure/GitRepoFixture.cs index 89e01b02..63fa502b 100644 --- a/tests/ClaudeDo.Worker.Tests/Infrastructure/GitRepoFixture.cs +++ b/tests/ClaudeDo.Worker.Tests/Infrastructure/GitRepoFixture.cs @@ -4,12 +4,16 @@ namespace ClaudeDo.Worker.Tests.Infrastructure; public sealed class GitRepoFixture : IDisposable { + private readonly string _rootDir; + public string RepoDir { get; } public string BaseCommit { get; } public GitRepoFixture() { - RepoDir = Path.Combine(Path.GetTempPath(), $"claudedo_gittest_{Guid.NewGuid():N}"); + // Repo one level below a unique parent: the sibling worktree root (.claudedo-worktrees) is the repo's parent, so it must be unique per fixture. + _rootDir = Path.Combine(Path.GetTempPath(), $"claudedo_gittest_{Guid.NewGuid():N}"); + RepoDir = Path.Combine(_rootDir, "repo"); Directory.CreateDirectory(RepoDir); RunGit(RepoDir, "init"); @@ -28,7 +32,7 @@ public sealed class GitRepoFixture : IDisposable try { // Force-remove read-only .git objects on Windows. - ForceDeleteDirectory(RepoDir); + ForceDeleteDirectory(_rootDir); } catch { /* best effort */ } }