Skip to content

test(ci): fix Windows json-parity test failures (sandbox home isolation)#43

Merged
NagyVikt merged 1 commit into
mainfrom
fix/ci-windows-parallel-home-isolation
Jun 25, 2026
Merged

test(ci): fix Windows json-parity test failures (sandbox home isolation)#43
NagyVikt merged 1 commit into
mainfrom
fix/ci-windows-parallel-home-isolation

Conversation

@NagyVikt

Copy link
Copy Markdown
Collaborator

What

Windows CI failed on parallel install writes Fish functions with direct login refresh path (expected: 1, actual: 2) across node 18/20/22.

Root cause

src/commands/parallel.ts resolves ~/.claude-accounts via os.homedir(). On Windows, os.homedir() reads USERPROFILE and ignores the HOME that withSandbox sets. So every sandbox shared the runner's real home dir, and accounts leaked across tests:

  • parallel aliases… adds account1 + account2
  • parallel install… adds account1, then enumerates 2 stale profiles → writes 2 Fish files → asserts 1 → fail

Linux/macOS pass because os.homedir() honors HOME there.

Fix

Set USERPROFILE: tempHome alongside HOME in withSandbox. Node's os.homedir() honors USERPROFILE on Windows, restoring per-test isolation on every platform. Test-only change; no production behavior touched.

Verify

npm test  # 196 pass, 0 fail (Linux)

Real proof is the Windows CI matrix on this PR.

os.homedir() ignores HOME on Windows and reads USERPROFILE, so each
withSandbox call leaked into the real home dir. Accounts added by one
test (account1+account2) bled into the next, so 'parallel install writes
Fish functions' saw 2 stale profiles and asserted 1. Set USERPROFILE
alongside HOME to keep the sandbox isolated on every platform.
@NagyVikt NagyVikt merged commit dd68954 into main Jun 25, 2026
12 checks passed
@NagyVikt NagyVikt deleted the fix/ci-windows-parallel-home-isolation branch June 25, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant