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(wsl): pin the stopped-distro hold for a non-WSL shell in a WSL UNC folder - #35969
This PR adds tests only. A review of #35938 asked whether a PowerShell, cmd or Git Bash terminal opened in a WSL folder (\\wsl.localhost\... or \\wsl$\...) could skip the stopped-distro check on restore. It can't. These tests lock that in.
What Changed
Nothing changes for users; there is no source change.
Local terminal path: the launch plan sees a WSL UNC folder and runs wsl.exe in that distro whatever shell was chosen, so the hold always knows the distro.
Daemon path: the distro comes from the UNC folder first, before the session or the shell.
The new tests cover both paths, each with a PowerShell shell override in a non-WSL workspace:
a passive restore from either UNC spelling is held while the distro is stopped, and nothing is spawned;
a launch the user opens isn't held and doesn't read the distro state;
a Windows (host) folder is left alone.
The local test file's ../wsl mock now uses the real shared UNC parser instead of a regex that only knew \\wsl.localhost.
Why
The gap reported during review would only have existed if a non-WSL shell kept a UNC folder without a distro. Tests on both providers are cheaper than new code, and they would catch a future change that stops forcing wsl.exe for UNC folders.
Linked Issue
Internal WSL rewrite, follow-up to the review of #35938.
Visual Proof
N/A. Tests only.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Both test files pass: 43 tests. typecheck:ci, oxlint and check:code-quality:changed pass. Tested on macOS with Windows mocked.
Review
Flag-off: no change (tests only).
User-risk: none (tests only).
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
No impact on SSH, folder workspaces, mobile or performance; this PR only adds tests.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Walkthrough
The tests cover passive restores from non-WSL shells with WSL UNC working directories. They check that a stopped distro produces a hold without spawning, while a user-initiated launch does not read distro state. They also check that host-path working directories do not trigger a distro-state read. The provider test mock now uses the real WSL UNC parser to cover both supported path spellings.
Priority: Low
Merge Risk: Minimal · up to 67f96
The change adds test coverage without identified merge-blocking risk.
Pre-merge checks: 5
Check name
Status
Explanation
Title check
The title clearly identifies the test coverage for stopped-distro holds in WSL UNC folders with non-WSL shells.
Description check
The description is mostly complete and explains the scope, test coverage, rationale, validation, and cross-platform impact. The Linked Issue section does not provide an actual issue link or Fixes refe…
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description is mostly complete and explains the scope, test coverage, rationale, validation, and cross-platform impact. The Linked Issue section does not provide an actual issue link or Fixes reference, and the AI Disclosure section is omitted.
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.
Finishing Touches
📝 Generate docstrings
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
This PR adds tests only. A review of #35938 asked whether a PowerShell, cmd or Git Bash terminal opened in a WSL folder (
\\wsl.localhost\...or\\wsl$\...) could skip the stopped-distro check on restore. It can't. These tests lock that in.What Changed
Nothing changes for users; there is no source change.
wsl.exein that distro whatever shell was chosen, so the hold always knows the distro.The new tests cover both paths, each with a PowerShell shell override in a non-WSL workspace:
The local test file's
../wslmock now uses the real shared UNC parser instead of a regex that only knew\\wsl.localhost.Why
The gap reported during review would only have existed if a non-WSL shell kept a UNC folder without a distro. Tests on both providers are cheaper than new code, and they would catch a future change that stops forcing
wsl.exefor UNC folders.Linked Issue
Internal WSL rewrite, follow-up to the review of #35938.
Visual Proof
N/A. Tests only.
Testing
Both test files pass: 43 tests.
typecheck:ci, oxlint andcheck:code-quality:changedpass. Tested on macOS with Windows mocked.Review
Agent skill upstream boundary
Notes
No impact on SSH, folder workspaces, mobile or performance; this PR only adds tests.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)