FN-5965: use temporary root in worktree recovery test

Harden executor worktree recovery coverage against fixed-path collisions.

- create a unique temporary root for the stale unregistered worktree test case
- derive the stale worktree path from that temporary root instead of a shared /tmp/test path
- initialize TaskExecutor with the same temporary root so setup and assertions stay aligned

Files changed:
 packages/engine/src/__tests__/executor-worktree.test.ts | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-5965

Fusion-Task-Lineage: 4436bd02-b7f7-4e62-8514-0aef6cb67813
This commit is contained in:
gsxdsm
2026-06-03 16:29:09 -07:00
parent 05098e4033
commit 8d31370b0b

View File

@@ -1695,7 +1695,8 @@ describe("TaskExecutor worktree recovery", () => {
it("removes existing directory that is not a registered worktree", async () => {
const store = createMockStore();
const fs = await import("node:fs/promises");
const staleWorktreePath = "/tmp/test/.worktrees/swift-falcon";
const tempRoot = await fs.mkdtemp("/tmp/executor-worktree-");
const staleWorktreePath = `${tempRoot}/.worktrees/swift-falcon`;
// Directory exists but is not registered
mockedExistsSync.mockReturnValue(true);
@@ -1712,7 +1713,7 @@ describe("TaskExecutor worktree recovery", () => {
return Buffer.from("");
});
const executor = new TaskExecutor(store, "/tmp/test");
const executor = new TaskExecutor(store, tempRoot);
await executor.execute(makeTask());
expect(