Skip to content

test(e2e): release the early-typing rc only once the keys reach the tty - #35522

Merged
nwparker merged 1 commit into
mainfrom
nwparker/e2e-early-typing-arrival-order
Oct 29, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/e2e-early-typing-arrival-order

Conversation

@nwparker

@nwparker nwparker commented Oct 29, 2026 •

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

ELI5

Our test for "keys typed before a remote terminal's first prompt aren't lost" used to let the shell finish starting the moment the keys were typed. On Linux CI the keys sometimes hadn't reached the remote machine yet, so the test couldn't check that they arrived before the prompt and only checked that they ran exactly once. Now the test waits until the remote terminal has visibly received the keys, then lets the shell finish, and checks the stronger thing again: the keys arrived before the first prompt.

What Changed

tests/e2e/headless-paired-remote-terminal-early-typing.spec.ts (test only):

  • After pressing Enter, the test polls until the pane shows the typed line. That is the remote terminal's own echo, which can only appear while the shell's startup file is still waiting (no prompt exists yet). Only then does it confirm the release file is still absent and write it.
  • It restores the check that the typed line comes before the startup file's prompt. It keeps the checks that the prompt appears and that the command's output appears exactly once.

Why

When #35312 ran on Linux CI, the typed line showed up after the prompt. Host-side timing logs from a diagnostic run (40768092038) showed why:

  • The keys reached the remote terminal 1–40 ms after the startup file had already finished, because the test released it right after Enter. The startup file polls every 50 ms, and the keys' trip from the client to the host sometimes took longer.
  • The startup file's own read -t 0 check confirmed nothing was waiting on the terminal at release.
  • Nothing was lost or held: the startup file's early output reached the pane, and the command ran whole, exactly once.

So #35312 had dropped the ordering check. Gating the release on the echo removes the race, so the check can come back and be deterministic.

  • Flag-off: N/A. Test-only, with no product code change.
  • User risk: None for shipped behavior. The only risk is test flakiness; the Linux run below repeated it 5× with no flakes.

Linked Issue

N/A. Follow-up to #35312.

Visual Proof

N/A. Test-only change.

Testing

  • Linux changed-specs lane, 5× in one e2e.yml dispatch (run 40797015966, on a diag-only branch that adds repeatEach: 5 and has been deleted): 5 passed.
  • Locally on macOS (hidden, ORCA_BACKGROUND_LAUNCH=1, ORCA_E2E_WEB_CLIENT=1, --repeat-each=3): 3 passed.
  • pnpm tc and pnpm run typecheck:ci pass. So do oxlint on tests/e2e, the anti-slop lint, the ast-grep gates, check:process-host-imports and check:code-quality:changed.

AI Disclosure

Review

This touches terminal-restore tests, so it needs two reviewers.

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. Cross-platform: the same spec runs on macOS and Linux.

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)

The rc was released right after Enter, so on Linux CI the keys' trip to the host
sometimes outlasted the rc's 50 ms poll and they landed after the prompt. Wait for
the tty's echo of the typed line first, which appears only if the bytes reached
the PTY while the rc still waited, and restore the check that they came before
the first prompt.
@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 15 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: 11a9beb2-3312-4359-93b4-48402d47b91e
Commits

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

Files selected for processing: 1
  • tests/e2e/headless-paired-remote-terminal-early-typing.spec.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] This test-only change appears safe to merge.

Summary

Strengthens the early-typing test without changing shipped behavior.

  • The early-typing test waits for input before releasing shell startup.

No actionable issues found. No tests were run during this review.

Reviews (1) · Last reviewed commit: "test(e2e): release the early-typing rc o..." · Reviewed by Greptile

@nwparker
nwparker merged commit 1ffea48 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