Skip to content

test: bound tmux input capture waits and diagnose failed key sends - #13173

Merged
teamleaderleo merged 2 commits into
mainfrom
test-bound-tmux-input-capture
Sep 21, 2026
Merged

teamleaderleo merged 2 commits into
mainfrom
test-bound-tmux-input-capture

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The tmux input-mapping tests currently record failed synthetic key sends with nonfatal assertions, then wait for commands those sends never produced. The pipe writer remains open until capture exits, so missing output can leave the test waiting until Xcode's five-minute allowance kills the host. This pattern was observed on #13117 and #13160; it does not establish either PR caused the underlying input failure.

Make failed key sends fatal preconditions. Require a usable window and report hosted-window/live-surface state to help distinguish attachment failures. Extract the command collector into a test helper with a five-second, cancellable deadline and explicit errors for incomplete output. Read events feed an async stream; deadline/cancellation can finish that stream even while the writer remains open. The read source owns a duplicate descriptor and closes it after event delivery stops.

This bounds pipe waits and improves diagnostics. It does not fix or claim to establish the underlying window/readiness cause, does not change the initial runtime-readiness wait, and does not fix the separate CI classifier that can accept timeout/restart runs.

Validation

  • First commit extracts the existing collector without changing its behavior and adds regression coverage. The incomplete-EOF test fails; the silent-pipe probe remains blocked beyond its 25 ms deadline and is terminated by a three-second external watchdog.
  • After the fix, six Swift Testing tests pass against the exact helper/test files in a small temporary Foundation-only SwiftPM harness: silent pipe, partial output, incomplete EOF, command filtering/order, failed send, and cancellation with the writer still open. Deadline tests use the existing virtual clock and assert outcomes rather than elapsed time.
  • Test wiring lint, Xcode project normalization, focused determinism checks, Swift parsing of the edited app-host suite, and git diff --check pass.
  • Full app-host target compilation/execution remains pending in hosted CI. No app runtime code changed, and no live CI runs were cancelled or retried for this investigation.

Related investigation: #13095.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Bounds tmux input-mapping test waits so failed key sends and silent pipes fail fast instead of hanging until Xcode kills the test host.

  • Failed synthetic key sends are now fatal preconditions; tests require a usable window and report hosted-window/live-surface state.
  • Extracts command collection into RemoteTmuxInputCommandCapture, a test helper with a 5-second cancellable deadline and explicit timeout/EOF errors.
  • Reads pipe output through an async stream backed by a duplicated descriptor so cancellation can finish while the writer stays open.
  • This doesn't fix or prove the underlying window/readiness cause; runtime-readiness waits and the CI classifier are unchanged.

Written for commit b61708c. Summary will update on new commits.

Review in cubic

@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 6 minutes.

Check out review usage here.

View limit details

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

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 3399906b-5627-48b3-825d-af5558106e70

📥 Commits

Reviewing files that changed from the base of the PR and between 02cd032 and b61708c.

📒 Files selected for processing (4)
  • cmux.xcodeproj/project.pbxproj
  • cmuxTests/RemoteTmuxInputCommandCapture.swift
  • cmuxTests/RemoteTmuxInputCommandCaptureTests.swift
  • cmuxTests/RemoteTmuxMirrorPaneInputMappingTests.swift

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.

@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@greptile-apps

greptile-apps Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge and only improves the determinism and diagnostics of test infrastructure.

Summary

This PR makes tmux input-mapping tests terminate deterministically when synthetic input fails or captured output remains incomplete.

  • Extracts command collection into a five-second, cancellation-aware test helper.
  • Adds focused coverage for silence, partial output, EOF, filtering, send failure, and cancellation.
  • Converts failed key delivery and missing-window conditions into fatal test preconditions with diagnostics.
  • Correctly registers the new helper and tests in the cmuxTests target.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Validate expected command count] --> B[Send synthetic input]
  B -->|Failure| C[Fail test immediately]
  B -->|Success| D[Read duplicated pipe descriptor]
  D --> E{Expected commands received?}
  E -->|Yes| F[Return commands and cancel resources]
  E -->|EOF first| G[Throw incomplete EOF error]
  E -->|Deadline first| H[Throw timeout with received count]
  E -->|Task cancelled| I[Propagate cancellation]
Loading

Reviews (1) · Last reviewed commit: "test: bound tmux command capture and sto..."

@teamleaderleo
teamleaderleo merged commit 903088e into main Sep 21, 2026
51 of 53 checks passed
rustybret pushed a commit to rustybret/bmux that referenced this pull request Sep 21, 2026
903088e test: bound tmux input capture waits and diagnose failed key sends (manaflow-ai#13173)
82acb3c ci: bound optional compile-admission lookup time (manaflow-ai#13258)
52b9950 Merge pull request manaflow-ai#13306 from manaflow-ai/13070-cloud-sidebar-reference-layout-followup
e9f61b9 fix: restore reference Cloud sidebar layout
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