Skip to content

test: scale the SSH retry-budget test's process deadline with its attempt count - #14068

Closed
teamleaderleo wants to merge 2 commits into
mainfrom
fix-ssh-reattach-retry-timeout
Closed

teamleaderleo wants to merge 2 commits into
mainfrom
fix-ssh-reattach-retry-timeout

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

SSHDeepSleepReattachTests.foregroundAuthenticatedAttachUsesConfiguredRetryBudget fails on main's app-host shard 3 whenever the shard runs slowly. The test runs the generated attach script through the whole 20-attempt fallback retry budget. Each attempt spawns uuidgen, the fake ssh, cmux and sleep. The harness's runProcess gave the script a fixed 5 s deadline, and a full budget takes about 3.8 s per case even on an idle runner. Under shard load the harness SIGTERMs the script before it finishes: status 143 after 19 of 20 sleeps, as in runs 35843579677 (09:32Z) and 35882157190 (15:31Z). The 12:41Z run passed in 8.97 s for the two cases, just under the limit.

runProcess now takes a timeout parameter, which defaults to the old 5 s. This test passes max(5, (expectedSleepCount + 1) * 2), which is 42 s for 21 attempts. The deadline only limits how long a hang can run: a passing script returns when it exits, so a healthy run takes no longer. Every assertion is unchanged, including the full 20-sleep budget and the backoff sequence. No other caller changes.

This is timing, not logic. The test passes when run alone on main.

Testing

Blacksmith test-depot dispatches, one fresh process each, suite SSHDeepSleepReattachTests:

  • Base 72490a9deb (run 35934027300): Test run with 10 tests in 1 suite passed. The target took 7.641 s for its 2 cases, about 3.8 s each against the 5 s deadline. The same run's other selector failed (a separate test, see below).
  • This branch d2126d9891 (run 35934029692): Test run with 10 tests in 1 suite passed, target 7.664 s, ** TEST SUCCEEDED **.

Not verified: a loaded shard run on this branch. The failure needs shard load, which an isolated dispatch doesn't reproduce. So the evidence is the margin (about 3.8 s used of a 42 s deadline), not a red-to-green flip.

#13752 also fixes this test, differently: it cuts the loop to a 4-attempt budget and adds a budget-resolution probe. That PR is 35 files and red on all app-host shards. This change is only the harness deadline, so it can land alone.

Checklist

  • I tested the change locally
  • I added or updated tests for behavior changes
  • I updated docs/changelog if needed

— Ibex g1 🌿 (subagent)
🤖 Generated with Claude Code


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

Scales the SSH retry-budget test's process deadline with the expected attempt count so the script isn't SIGTERMed under shard load.

The full 20-attempt budget takes about 4.5 s per case on an idle runner against the fixed 5 s deadline, causing status 143 after 19 sleeps on slow shards. runProcess now accepts a timeout parameter defaulting to 5 s; the test passes max(5, (expectedSleepCount + 1) * 2), 42 s for 21 attempts. The deadline only bounds hangs, so assertions and the full budget are unchanged and no other callers change.

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

Review in cubic

Summary by CodeRabbit

  • Tests
    • Adjusted a test’s process timeout to scale with the expected number of retry attempts, reducing the chance of premature test failures while still bounding hangs.

foregroundAuthenticatedAttachUsesConfiguredRetryBudget runs the full
20-attempt fallback budget through fake ssh/cmux/sleep, which takes about
4.5 s per case on an idle runner, against a fixed 5 s process deadline.
Under shard load the harness SIGTERMed the script after 19 sleeps (status
143). The deadline now scales with the attempts the case expects; the
assertions are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

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

@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 19e47575-6208-4bfd-ba2d-8a15cde998a6

📥 Commits

Reviewing files that changed from the base of the PR and between d2126d9 and b7ea132.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 9c1dfc6f-fbb5-4e20-bd3f-b5726ce6bf97

📥 Commits

Reviewing files that changed from the base of the PR and between cf8b073 and d2126d9.

📒 Files selected for processing (1)
  • cmuxTests/SSHDeepSleepReattachTests.swift

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


📝 Walkthrough

Walkthrough

The retry-budget test now sets a timeout based on the expected sleep count. The runProcess helper accepts an optional timeout and uses it before terminating a timed-out process.

Changes

SSH reattach test timeout

Layer / File(s) Summary
Configure the process timeout
cmuxTests/SSHDeepSleepReattachTests.swift
runProcess accepts a timeout that defaults to 5 seconds and uses it when waiting for process completion. The retry-budget test passes a timeout calculated from the expected sleep count.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: austinywang

Merge Risk: ⚪ Minimal · up to d2126

This test change does not establish a material risk that should block merging.

🚥 Pre-merge checks | ✅ 24 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (24 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: scaling the SSH retry-budget test process deadline with its attempt count.
Description check ✅ Passed The description explains the failure, the timeout change, the rationale, and the testing performed. It also documents that loaded-shard verification was not completed. The omitted demo video and revie…
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.
Cmux Cloud Persistent Session And Early Input ✅ Passed PASS. The pull request changes only cmuxTests/SSHDeepSleepReattachTests.swift. It adds a configurable process timeout to a test helper and uses it for the retry-budget test. It does not change Cloud…
Cmux Swift Actor Isolation ✅ Passed PASS. The pull request changes only cmuxTests/SSHDeepSleepReattachTests.swift. It adjusts a private test helper timeout and one test call. No production Swift files, models, service protocols, Senda…
Cmux Swift Blocking Runtime ✅ Passed PASS. The diff changes only cmuxTests/SSHDeepSleepReattachTests.swift, which is part of the cmuxTests test target. It adds a configurable deadline to the private runProcess test harness and uses…
Cmux Browser Automation Off-Main ✅ Passed PASS: The pull request changes only cmuxTests/SSHDeepSleepReattachTests.swift. It adds a configurable process timeout for an SSH retry-budget test and does not change browser socket commands, WebKit…
Cmux Expensive Synchronous Load ✅ Passed PASS: The PR changes only the cmuxTests/SSHDeepSleepReattachTests.swift test harness. It adds a configurable Process timeout and does not add or move any agent-history loader, file scan, JSON/JSON…
Cmux Cache Substitution Correctness ✅ Passed PASS: The PR changes only cmuxTests/SSHDeepSleepReattachTests.swift. It adds a configurable timeout to the private test-process harness and uses it for the SSH retry-budget test. The diff does not r…
Cmux No Hacky Sleeps ✅ Passed PASS. The only changed file is cmuxTests/SSHDeepSleepReattachTests.swift. The diff changes a private test helper to accept a configurable process deadline and passes a retry-count-based timeout for …
Cmux Algorithmic Complexity ✅ Passed PASS. The PR changes only cmuxTests/SSHDeepSleepReattachTests.swift. It adds a scalar timeout parameter to the private test helper and computes a timeout from the fixed test attempt count. It adds n…
Cmux Swift Concurrency ✅ Passed The diff only adds a configurable timeout and passes it to the existing process-test helper. The existing DispatchQueue.global(...).async and DispatchSemaphore synchronization is unchanged, and th…
Cmux Swift @Concurrent ✅ Passed PASS: The PR changes only a synchronous test helper and its timeout argument. It adds no async, nonisolated async, or @concurrent declaration, and it does not change actor isolation or introduce…
Cmux Swift Package Boundaries ✅ Passed PASS. The authoritative diff changes only cmuxTests/SSHDeepSleepReattachTests.swift. It updates a test-only runProcess helper and one test timeout. It does not introduce or expand production featu…
Cmux Swiftpm Lockfiles ✅ Passed PASS: The authoritative PR diff changes only cmuxTests/SSHDeepSleepReattachTests.swift. It does not change Package.swift, Package.resolved, .gitignore, workflow files, or Xcode project package…
Cmux Swift Logging ✅ Passed PASS: The PR changes only cmuxTests/SSHDeepSleepReattachTests.swift. It adds a configurable process timeout and updates one test call. It adds no print, debugPrint, dump, NSLog, Logger, or…
Cmux User-Facing Error Privacy ✅ Passed PASS. The pull request changes only cmuxTests/SSHDeepSleepReattachTests.swift. The changes affect a private test helper, its test caller, and developer-only test comments. No production user-facing …
Cmux Full Internationalization ✅ Passed PASS: The pull request changes only cmuxTests/SSHDeepSleepReattachTests.swift. The changes adjust a test helper timeout and add a developer-only comment. The internationalization rule explicitly all…
Cmux Swiftui State Layout ✅ Passed PASS: The PR changes only cmuxTests/SSHDeepSleepReattachTests.swift. It adds a configurable process timeout to a test helper. The file imports AppKit, Foundation, and Testing, not SwiftUI. The…
Cmux Architecture Rethink ✅ Passed PASS. The diff changes only cmuxTests/SSHDeepSleepReattachTests.swift. It adds a configurable deadline to the existing test-only runProcess harness and applies the longer deadline only to the retr…
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed The PR changes only the test file cmuxTests/SSHDeepSleepReattachTests.swift. It adjusts runProcess timeout handling and the retry-budget test. The diff adds no NSWindow, NSPanel, `NSWindowCont…
Cmux Source Artifacts ✅ Passed The only changed path is cmuxTests/SSHDeepSleepReattachTests.swift. The diff contains hand-written Swift test logic and a configurable process timeout. It does not add logs, screenshots, caches, bui…
Cmux No Test Or Debug Seam In Production Source ✅ Passed PASS. The review-scoped diff changes only cmuxTests/SSHDeepSleepReattachTests.swift. It changes test harness code and does not modify any Swift file under a production Sources/ path, so this produ…
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Status on d2126d9891:

  • The focused suite run passed: run 35934029692 printed Test run with 10 tests in 1 suite passed, and the target took 7.664 s for its 2 cases.
  • On this PR's own CI, app-host shard 1/7 is red. Its failures are WorkspaceTerminalFocusRecoveryTests/testTerminalFirstResponderFeedbackPreservesActiveFocusTransaction and CmuxTuiSurfaceProviderRegistryPollingTests/unavailableCloudDoesNotPrepare(enabled:). Both also fail on main, and this change touches neither. I'm diagnosing the focus test separately. Shard 3/7 holds the SSH retry test and is still running.

No bot review threads are open yet.

— Ibex g1 🌿

@cursor

cursor Bot commented Sep 24, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Superseded: main has baa7f27, which scales the SSH retry-budget harness deadline with its attempt count (via #13151).

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