Repository navigation
test(wsl-host): type into the WSL host terminal only after its shell prompt - #34607
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
…prompt On CI the first keystrokes typed right after the WSL host terminal attached were sometimes dropped (the shell received "L HOST TERMINAL ..."), leaving an open quote, so the marker never printed. The spec now waits for the prompt, which names the project folder, before typing. The dropped input itself is a separate follow-up.
2fb9353 to
c0fb388
Compare
ELI5
An end-to-end test for WSL hosts types a command into a terminal and waits for its output. Sometimes it typed before the shell was ready, the first few keys were lost, and the test failed. The test now waits until the shell shows its prompt before typing.
What Changed
tests/e2e/wsl-host-fake-transport.spec.ts("adds a WSL distro as a host, adds a project on it, and runs a terminal there") now waits for the shell's prompt before it typesprintf 'WSL_HOST_TERMINAL_%s\n' ready. It recognizes the prompt by the project folder's name, which the prompt includes. Two added lines, test only.Before: on CI the shell sometimes received
L HOST TERMINAL % s\n' ready. The openingprintf 'WSwas dropped, the quote stayed open, the marker never printed, and the test timed out after 30 s. Seen in #33911 (run 40575191833, twice) and #34573 (run 40596517791), which share no code, so the flake was already on main.After: typing starts only once the shell is reading input.
Why
The test checks that a terminal on a WSL host works, not how early a terminal can accept keystrokes, so waiting for the prompt keeps it on its subject. Losing keys typed right after a remote terminal attaches is a real but separate issue, tracked as its own follow-up. This change doesn't hide it from any test written to check that.
Linked Issue
N/A (maintainer test fix).
Visual Proof
N/A: test-only change, nothing user-facing.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
The test passed 3 out of 3 runs (
--repeat-each=3, background launch, non-symlinkedTMPDIRon macOS) against a fresh build of this branch.pnpm tc,pnpm run typecheck:ci,check:code-quality:changedand the flaky-test pattern ratchet pass.AI Disclosure
Review
Agent skill upstream boundary
Notes
Test only; no product, platform, SSH or mobile impact.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (typecheck and the touched e2e test locally; full lint/test left to CI per load rule)