From 4c31ba52e682c03d4e2946e0ec861f2da18e8441 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Wed, 28 Oct 2026 16:40:50 -0700 Subject: [PATCH] test(worktree): check concurrent create names, not which create reached Git first (#35457) --- src/main/runtime/runtime-local-worktree-create.test.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/runtime/runtime-local-worktree-create.test.ts b/src/main/runtime/runtime-local-worktree-create.test.ts index a1a350fe76c..b53252d47ce 100644 --- a/src/main/runtime/runtime-local-worktree-create.test.ts +++ b/src/main/runtime/runtime-local-worktree-create.test.ts @@ -132,9 +132,11 @@ describe('runtime concurrent creates on one name', () => { { request: { name: 'nautilus', nameWasGenerated: true }, second: null } ])('gives the second create of $request.name its next candidate', async ({ request, second }) => { await Promise.all([createWorktree(request), createWorktree(request)]) - const [first, other] = addedPaths().map((path) => basename(path)) - expect(first).toBe(request.name) - expect(other).not.toBe(first) + // Claims are ordered, but each create resolves its path's realpath before Git's add, so on a + // loaded runner either create can reach add first. Check the names, not the call order. + const names = addedPaths().map((path) => basename(path)) + expect(names.filter((name) => name === request.name)).toHaveLength(1) + const other = names.find((name) => name !== request.name) ?? '' if (second) { expect(other).toBe(second) } else {