Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/main/runtime/runtime-local-worktree-create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading