Skip to content

test: restore delayed PTY writes in large-paste coverage - #24556

Merged
nwparker merged 1 commit into
mainfrom
nwparker/test-audit-paste-delay
Oct 2, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/test-audit-paste-delay

Conversation

@nwparker

@nwparker nwparker commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

The large-paste responsiveness test intended to simulate slow terminal writes, but its injected delay was always invalid. Restore that delay so the test exercises its claimed workload.

What Changed

Read the requested delay from the second argument of Electron's main-process evaluation callback. The first argument is the Electron context. Narrow the helper's app dependency to evaluation and add a unit regression using that callback contract, including resetting the delay.

Why

The old callback stored NaN instead of 35ms, bypassing the spy's slow-write branch. The regression fails before and passes after. Correcting the injection preserves the existing paste workflow and production code; increasing timing budgets would leave its missing workload untested.

Linked Issue

N/A — maintainer test audit.

Visual Proof

N/A — test instrumentation only; no application change.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

macOS: unit regression reproduced NaN with the old callback and passed with the corrected callback, including clearing the delay. Targeted lint, formatting, changed-code quality and diff checks passed. The separately run E2E typecheck no longer reports this helper's callback error. The real background Electron large-paste workflow passed three times with the intended 35ms write delay. Full-suite verification continues separately.

Review

Self-reviewed callback argument order, delay reset, mock restoration and the narrower dependency type. No test windows were revealed.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

No production, UI, remote-wire or mobile behavior changes. The callback contract is platform-independent.

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)

@coderabbitai

coderabbitai Bot commented Oct 2, 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 42 seconds.

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

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 58c1f2e1-3ef7-455b-95d7-33849d939cd0

📥 Commits

Reviewing files that changed from the base of the PR and between b666d07 and 87a67b5.

📒 Files selected for processing (2)
  • tests/e2e/helpers/terminal-pty-write-spy.ts
  • tests/e2e/helpers/terminal-pty-write-spy.unit.test.ts
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@nwparker
nwparker merged commit c9a9b8d into main Oct 2, 2026
4 of 5 checks passed
@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Low risk] Test helpers for terminal write delays.

The PR appears safe to merge.

Summary

The PR corrects the delay argument passed into the terminal PTY write spy and adds a unit regression that checks both setting and clearing the delay. No production behavior changes.

Reviews (1) · Last reviewed commit: "test: restore delayed PTY writes in larg..."

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