Repository navigation
test(bridge): only treat a Linux process as inside WSL2 - #474
Merged
Merged
Conversation
Windows Terminal sets WSLENV (WT_SESSION:WT_PROFILE_ID:) in every Windows profile, so the bridge transport suite took a Windows PowerShell for a WSL2 distro and ran four WSL-only tests there: the fake npiperelay is a node script Windows cannot execute, and the bridge fell back to the real wmux pipe, which answered unauthorized. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
tests/unit/wmux-bridge-transport.test.tsdecides it runs inside WSL2 fromWSL_DISTRO_NAME || WSLENV. On Windows that is wrong: Windows Terminal setsWSLENV=WT_SESSION:WT_PROFILE_ID:in every Windows profile.Effect
In a Windows Terminal PowerShell the four WSL-only tests are not skipped and fail: the fake
npiperelay.exeis a#!/usr/bin/env nodescript that Windows cannot execute (spawnCountis 0, the slow-relay test gets''), and the bridge falls back to the default\\.\pipe\wmux, which is the real running wmux and answersunauthorized. The failing tests also send their payload to that real pipe.Fix
isWslRuntimealso requiresprocess.platform === 'linux': only a Linux process can be inside a WSL2 distro.Verification
WSLENV=WT_SESSION:WT_PROFILE_ID:: the four tests failed before; withWSLENVcleared (what the fix amounts to) all six skip.WSLENVset, so the WSL-only tests run, 5 pass and 1 skips.🤖 Generated with Claude Code