Repository navigation
test(wsl): measure the old bridge's ConPTY terminal after a distro restart - #35662
Conversation
…start The restart baseline only had a non-PTY wsl.exe exec as the old bridge's lower bound. The lane now also runs the bridge as the app does: wsl.exe in a ConPTY with the bridge's WSL terminal setup command and the probe typed ahead, recording first paint and first command output, median of 3, alongside the host and exec runs. Test-only.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 8 minutes. View limit details
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. Comment |
[Low impact] The change only affects a gated real-WSL test lane. Match the bridge's actual terminal launch before merging this benchmark. Findings
SummaryAdds a third distro-restart benchmark arm using
Reviews (1) · Last reviewed commit: "test(wsl): measure the old bridge's ConP..." · Reviewed by Greptile |
| const setup = ['cd "$HOME"', buildWslInteractiveLoginShellCommand()].join(' && ') | ||
| const started = performance.now() | ||
| const terminal = pty.spawn( | ||
| resolveWslExecutablePath(), | ||
| buildWslExecArgs(PLAIN, ['sh', '-c', setup]), | ||
| { | ||
| cols: 120, | ||
| rows: 30, | ||
| cwd: resolveWslInteropSpawnCwd(), | ||
| env: { ...process.env } |
There was a problem hiding this comment.
Baseline measures a different launch
This arm skips setup that the bridge uses: useConptyDll: true, shell wrapper creation, and passing ORCA_SHELL_READY_ROOT through WSLENV. On a fresh lane runner, buildWslInteractiveLoginShellCommand() therefore starts a plain login shell instead of loading the bridge's Bash wrapper. The recorded timings compare different terminal and shell startup paths, so they cannot serve as the intended bridge baseline.
Reuse the bridge's launch setup, environment, and ConPTY options before recording these numbers.
ELI5
The real-WSL test already measures how long a terminal takes to answer after a WSL distro restart: once for the new WSL host and once for a bare
wsl.execommand, which undercounts the old way. This adds the old way as Orca actually runs it, a real terminal (ConPTY) runningwsl.exe. That gives the new host a fair number to beat.What Changed
distroRestartBaselinein the phase-3 lane gains a third arm,restartThroughBridgeConpty:wsl --terminatethe lane's own distro;wsl.exein a ConPTY (node-pty, built for Node in this job) with the same setup command the bridge's WSL terminals use:cd, thenbuildWslInteractiveLoginShellCommand, the distro's interactive login shell;printfprobe ahead, and recordfirstPaintMs(first byte from the terminal) andfirstOutputMs(the probe's output).The arms alternate (host, exec, ConPTY), and the receipt adds
bridgeConpty,medianBridgeConptyFirstPaintMsandmedianBridgeConptyFirstOutputMs.Why
The host's cold-start budget should be set against the bridge terminal users actually get. The exec lower bound skips the ConPTY start and the interactive shell's paint.
Flag-off: this is test-only; nothing ships.
Linked Issue
Internal WSL-via-orcad tracker D3 bars (reboot → prompt), following #34864.
Visual Proof
N/A: this adds a test only.
Testing
typecheck:ci, oxlint, the changed-code gate and the flaky-test ratchet pass. The numbers come from this PR's WSL2 lane run.Checklist
N/Afor visuals with reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (CI runs them)