You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test race: platform-binary.test.ts creates src/node_modules while api-deprecated-paths.test.ts scans src/ #694
A full local `pnpm test` can fail intermittently in `packages/cli/test/api-deprecated-paths.test.ts` with `ENOENT` on `packages/cli/src/node_modules`. The test passes when run alone, and CI hasn't hit it yet.
Why
`platform-binary.test.ts` ("reports node_modules/.bin as the source when that tier answers", around line 208–221) creates `packages/cli/src/node_modules` as a fake workspace, then removes it.
`api-deprecated-paths.test.ts` walks `SOURCE_ROOT` (`packages/cli/src`) recursively with `readdir` (around line 32/52).
Vitest runs the files in parallel. When the walk lists `src/node_modules` and then descends into it after the other test has removed it, the walk throws `ENOENT`.
Found while iterating on #689; it isn't caused by that PR and is already on `main`.
Done when
`platform-binary.test.ts` no longer writes inside `packages/cli/src`. It should use a temp directory, or a fixture location the source walk never visits.
The source walk in `api-deprecated-paths.test.ts` skips `node_modules` (and tolerates entries that vanish mid-walk), so a stray directory can't break it.
Running both files together repeatedly (e.g. `pnpm exec vitest run test/platform-binary.test.ts test/api-deprecated-paths.test.ts` in a loop) passes every time.
Activity
test: stop the src/node_modules race between platform-binary and the …