Skip to content

test(wsl): measure lane restarts over one held socket - #35526

Merged
nwparker merged 1 commit into
mainfrom
nwparker/wsl-lane-held-socket
Oct 29, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/wsl-lane-held-socket

Conversation

@nwparker

@nwparker nwparker commented Oct 29, 2026 •

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

ELI5

The WSL speed test was timing a cost the app never pays. Each time it checked whether the terminal had printed, it opened a brand-new connection, and on WSL every new connection starts a new wsl.exe. The app opens one connection and keeps it. The test now does the same thing.

What Changed

  • Before: in the restart measurement, terminal.create, terminal.send, every terminal.read poll and terminal.close each opened a fresh connection to the host. On WSL, each one started a new wsl.exe bridge process. The bridge spawns crowded the cold start and inflated "restart to first output".
  • After: each restart opens one shared control connection, the same connection type the app holds per environment. All four calls go over it, and it is closed when the restart ends. Opening that connection is the first request, so its cost is still counted in the time to first output.
  • Other phases of the lane (survive and idle-release) keep their existing per-call requests.

Why

The owner set a target of 2.5 s median restart to first output, measured with one held socket. The old number mixed host start-up with repeated bridge spawns, so changes to the host's start-up could not be judged against the target. Reusing the app's own connection class keeps the lane measuring what users see, without a separate client that is only used in tests.

Flag-off: no product change; only the WSL lane test (runs with ORCA_RUN_WSL_ORCAD_LANE=1) changes.
User-risk: none; test-only. The lane's restart numbers will drop from earlier receipts, so baselines must be re-read from a run that includes this change.

Linked Issue

N/A (internal performance work).

Visual Proof

N/A: test-only change with no UI.

Testing

  • pnpm tc, pnpm run typecheck:ci, the changed-code quality gate, anti-slop oxlint and oxlint all pass.

  • The lane is skipped locally (needs a real WSL2 distro); it runs on the WSL lane in CI.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Test-only; no security, SSH, mobile or compatibility impact.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Each terminal read in the restart measurement opened a fresh connection,
which on WSL spawns a new wsl.exe bridge, so first-output time counted
bridge spawns the app never pays. Hold one shared control connection per
restart, as the app does.
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 14 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

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: 070e44f7-d92d-400b-83c3-15e7514392cd
Commits

Reviewing files that changed from the base of the PR and between 134226a and 9ea5c70.

Files selected for processing: 1
  • src/main/wsl/wsl-orcad-real-distro-idle-release-lane.test.ts
  • 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.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

The WSL restart measurement now sends terminal calls over one held connection.

  • The WSL restart measurement uses one connection for terminal requests.

No actionable issues found. The Windows-only WSL lane was not run during this review.

Diagram

sequenceDiagram
  participant Lane as WSL lane
  participant Control as Held connection
  participant Host as Orcad
  Lane->>Lane: Start timer and ensure host
  Lane->>Control: terminal.create
  Control->>Host: Open and authenticate one socket
  Control->>Host: Create terminal
  Lane->>Control: terminal.send
  Control->>Host: Send probe
  loop Until probe appears
    Lane->>Control: terminal.read
    Control->>Host: Read over the same socket
  end
  Lane->>Lane: Record time to first output
  Lane->>Control: terminal.close
  Control->>Host: Close terminal
  Lane->>Control: Close connection in finally
Loading

Reviews (1) · Last reviewed commit: "test(wsl): measure lane restarts over on..." · Reviewed by Greptile

@nwparker
nwparker merged commit 8b9d277 into main Oct 29, 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