Repository navigation
test(e2e): stage the WSL inline-image payload in a file - #29633
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
📥 Commits
You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
🧹 Nitpick comments: 1
tests/e2e/terminal-inline-images-windows.spec.ts: 1
81-84: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueClean up the payload file if the test fails before
rm -fruns.The test writes
payloadFileintotestRepoPathand relies on the typedrm -fcommand to delete it. IfexecInTerminalis never reached or fails, the file stays in the repository. The fixture documentstestRepoPathas a disposable repository per worker. This limits the impact, but the file can affect later tests in the same worker. Atry/finallywithrmSync(..., { force: true })removes this risk.Proposed fix
+import { rmSync, writeFileSync } from 'node:fs' -import { writeFileSync } from 'node:fs'Then wrap the steps from
execInTerminalto the end of the test intry { ... } finally { rmSync(path.join(testRepoPath, payloadFile), { force: true }) }.Source: Learnings
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
09761014-3dc2-4c4f-a503-ef39cd6994c2
📥 Commits
Reviewing files that changed from the base of the PR and between 2d2bccf and ddd3aed067eeb96b980a372b9fc8878a4a908fad.
📒 Files selected for processing: 3
config/scripts/pr-e2e-source-routing.mjsconfig/scripts/wsl-e2e-lane-contract.test.mjstests/e2e/terminal-inline-images-windows.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
ddd3aed to
e7d7b1a
Compare
e7d7b1a to
bd6ea00
Compare
ELI5
The "real WSL terminal" CI check sometimes failed on PRs that have nothing to do with terminals. In those runs the blue test image was missing. The images were fine. The test typed one very long command into the Linux shell before the shell was ready to read it, and Linux silently threw away most of that line. Now the test saves the image data to a file and types a short command that prints the file.
What Changed
terminal-inline-images-windows.spec.tstyped a single 24,495-character command (printf '<base64 payload>' | base64 -d). It did this the moment the terminal got its PTY, before WSL bash was showing its prompt. About 1 in 15 WSL runs, the printed output was missing part of the Kitty image data. Then either the blue image never appeared ("All three protocol images must appear in the rendered screenshot") or the rest of the output disappeared ("Terminal did not contain WINDOWS_INLINE_IMAGES_DONE").cat <file>; rm -f <file>; printf 'WSL_IMAGE_PROTOCOL=…', which is under 150 characters. The terminal receives byte-for-byte the same image output as before, so the rendering assertions are unchanged. The native Windows (PowerShell) variant is unchanged.config/scripts/pr-e2e-source-routing.mjsnow routes the spec to the lane, andconfig/scripts/wsl-e2e-lane-contract.test.mjschecks that.Why
Evidence I gathered:
sleep 3, so the terminal was in cooked mode. Bash's history recorded about 4,167 characters of the 24,495 sent, and the shell sat at a>continuation prompt.Alternatives I rejected:
The product is not at fault. Real users pasting a long line into a shell that hasn't started yet hit the same kernel limit in any terminal.
Linked Issue
N/A (internal CI flake; seen on #29597 and #29610)
Visual Proof
N/A: this is a test-only change. Failing screenshots (blue image missing) are in the
windows-wsl-terminal-tracesartifacts of runs 38884043896 and 38887618271.Testing
windows-wsl-e2e.ymldispatch runs, because WSL isn't available on macOS.wsl-e2e-lane-contract.test.mjs.AI Disclosure
Review
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)