Skip to content

test(wsl): measure distro restart to first output for the WSL host and an old-bridge lower bound - #34864

Merged
nwparker merged 2 commits into
mainfrom
nwparker/wsl-cold-start-baseline-lane
Oct 28, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/wsl-cold-start-baseline-lane

Conversation

@nwparker

@nwparker nwparker commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​108 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​108
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 0

ELI5

This adds a measurement to the real-WSL test run: after a WSL distro is stopped (the WSL VM itself stays up), how long until a terminal prints the output of a command? It compares a project on the new WSL host with a lower bound for the old way. It changes no shipped code.

What Changed

Phase 3 of wsl-orcad-e2e.yml (wsl-orcad-real-distro-idle-release-lane.test.ts) gains a second test, which runs after the idle-release check. First, one unrecorded warm-up run brings the WSL VM back up. Then it alternates three times between:

  • (a) WSL host: wsl --terminate, then manager.ensure (holder boots the distro, orcad deploys and starts, bridge pairs), terminal.create, and a printf whose output must appear in terminal.read. It records ensureMs, terminalCreatedMs and firstOutputMs.
  • (b) Old bridge, lower bound: wsl --terminate, then one non-PTY wsl.exe --exec into the login shell (picked the way Orca's WSL commands do, via buildWslLoginShellCommand, so rc files load), running the same printf. It records firstOutputMs. The real old bridge also starts ConPTY and paints a prompt, so this number undercounts it; treat it as a floor, not its first paint.

Medians go to the phase receipt under distroRestartToFirstOutput as medianHostFirstOutputMs, medianHostEnsureMs and medianBridgeExecLowerBoundMs, per distro family. The phase 3 step timeout rises from 15 to 30 minutes, and the WSL2 job cap from 30 to 40 minutes so it no longer cuts phase 3 short.

Why

The D3 bar "restart → first usable prompt at or below the bridge baseline" had no measured baseline. Running both paths on the same runner, alternated, keeps VM and cache warmth from favouring either one. What it measures is "distro restart with the VM warm → first command output", not a full machine reboot and not first paint.

Flag-off: this is test-only; nothing ships.
User-risk: none; test and CI workflow only.

Linked Issue

Internal WSL-via-orcad tracker D3 bars / E17 (restart → terminal).

Visual Proof

N/A: this adds a test only.

Testing

The workflow qualification and change-scope tests pass. The numbers come from this PR's WSL2 lane run. Earlier run (median of 3): ubuntu host ensure 4.8 s / first output 5.9 s / bridge exec floor 0.79 s; debian 4.3 / 5.4 / 0.59 s; fedora 3.4 / 4.3 / 0.43 s.

  • Automated tests added/updated

Status

Reviewer fixes applied: job cap raised to 40 min; names, receipt keys and this body relabelled. Rebased on main fe3eb45b857.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • N/A for visuals with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote impact considered
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (pnpm tc, typecheck:ci, touched tests, code-quality and anti-slop gates pass locally; CI runs the rest)

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5f96817c-1321-4a95-ab7e-b20ca85752ff
Commits

Reviewing files that changed from the base of the PR and between f69ca70 and d1e9b0c.

Files selected for processing: 2
  • .github/workflows/wsl-orcad-e2e.yml
  • src/main/wsl/wsl-orcad-real-distro-idle-release-lane.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

Walkthrough

The change adds a Windows-only cold-start timing baseline for Orca’s host-managed terminal and the direct WSL login-shell bridge. The test warms the WSL VM, alternates three measurements per path, records timings and medians, and terminates the distro. The Phase 3 workflow step now names the baseline and has a 30-minute timeout. The WSL2 distro job timeout increases to 40 minutes.

Priority: Low

Merge Risk: Moderate · up to d1e9b

The WSL2 run can end before the new baseline finishes and writes its receipt. Increase the job’s time budget before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the WSL restart-to-first-output measurement and the comparison with the legacy bridge lower bound.
Description check Passed The description is mostly complete. It explains the change, purpose, test method, reported results, visual-proof status, and testing status. It does not provide an actual linked issue URL or complete …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is mostly complete. It explains the change, purpose, test method, reported results, visual-proof status, and testing status. It does not provide an actual linked issue URL or complete several optional template sections, but the core information is present.

Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. 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 2 functions across 1 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4eb131e3-4c9a-4264-8eb9-ea88a56e13b5
Commits

Reviewing files that changed from the base of the PR and between bd9455b and f69ca70.

Files selected for processing: 2
  • .github/workflows/wsl-orcad-e2e.yml
  • src/main/wsl/wsl-orcad-real-distro-idle-release-lane.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

- name: 'Phase 3: idle orcad releases the distro'
timeout-minutes: 15
- name: 'Phase 3: idle orcad releases the distro; reboot-to-prompt baseline'
timeout-minutes: 30

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major · Stability & Availability · Quick win

Supported by static analysis

Script executed:

grep -n 'timeout-minutes\|^  [a-z0-9_-]*:$\|- name:' .github/workflows/wsl-orcad-e2e.yml

Repository: stablyai/orca

Length of output: 1641


Script executed:

sed -n '145,365p' .github/workflows/wsl-orcad-e2e.yml

Repository: stablyai/orca

Length of output: 14247


Increase the wsl2 job timeout beyond the Phase 3 timeout.

The job allows 30 minutes total, while Phase 3 alone allows 30 minutes. Earlier steps have configured timeout ceilings of 38 minutes when WSL installation is skipped, or 46 minutes when it runs. The import step overlaps dependency setup, so these are not guaranteed elapsed times, but the job deadline can still cancel Phase 3 before its 30-minute timeout. The new 20-minute baseline can therefore be interrupted before it writes its receipt.

…d bridge

The real-WSL lane's phase 3 now terminates its distro and times, median of 3 each, how long a
WSL-host project takes to a working terminal (holder boot, orcad start, terminal spawn and an
answered command) against one wsl.exe into the login shell, as the old bridge does. Test-only.
…ob cap

The baseline measures distro restart (VM warm) to first command output; the old-bridge figure is a
non-PTY wsl.exe --exec lower bound, not ConPTY first paint. The job cap rises to 40 minutes so it
no longer undercuts phase 3's own 30-minute timeout.
@nwparker
nwparker force-pushed the nwparker/wsl-cold-start-baseline-lane branch from f69ca70 to d1e9b0c Compare October 28, 2026 10:24
@nwparker nwparker changed the title test(wsl): measure reboot to first prompt for the WSL host and the old bridge test(wsl): measure distro restart to first output for the WSL host and an old-bridge lower bound Oct 28, 2026
@nwparker
nwparker merged commit fceb475 into main Oct 28, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant