Repository navigation
test: kill hosted test shells before freeing their terminals - #14957
Conversation
The committed-geometry fixture and many other test suites freed a live terminal with a bare releaseSurfaceForTesting() or teardownSurface(). When the shell is still in login(1)'s SIGHUP-ignoring startup, the free waits out Ghostty's 12 s SIGHUP grace: synchronously on the main thread for the release helper, or holding one of the coordinator's two close slots for teardownSurface(). Route those call sites through releaseHostedSurfaceForTesting() and a new teardownHostedSurfaceForTesting(), which SIGKILL the terminal's processes first. Both are no-ops beyond the plain call when no runtime exists. CloudRestoreReplayFixture keeps teardownSurface(): its manual-IO surface has no shell. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
All contributors have signed the CLA ✍️ ✅ |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Warning Review limit reachedNext included review available in 8 minutes. View limit detailsLimit 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. Review configuration: ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (20)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughTests and fixtures now use hosted-surface testing helpers for release and teardown. A new teardown helper kills hosted shell processes before calling ChangesHosted Surface Test Cleanup
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other Merge Risk: ⚪ Minimal · up to This PR changes test cleanup rather than product teardown, and the selected tests are reported to run faster. Whether a residual 12-second delay is possible remains unestablished, so no concrete merge-blocking regression is identified. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change is confined to test cleanup and does not expose a new production entrypoint. The remaining risk is limited to the test host: cleanup may target a process that no longer belongs to the terminal being closed. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 24 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (24 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
🛠️ Fix failing CI checks 💡
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. Comment |
ScrollbackTestTerminal hosts a .manualMirror surface, like CloudRestoreReplayFixture: there is no shell and Ghostty never reports a TTY, so killShellProcessesForTesting() would spin its full 1 s deadline on every close() and then do nothing. Go back to a bare teardownSurface(). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
CI failure attributionCI passes on Written by |
|
Merge receipt for |
82c26b3 ci: take the gui token in the app-host shard's restore, not at job start (manaflow-ai#15012) 3761671 iOS: fix stale team nightly floor expectation in What's New copy test (manaflow-ai#14917) 5e19a98 docs: focus custom sidebar tabs by surfaceId in the actions example (manaflow-ai#15002) 294ee6e sidebar: Strip inline Markdown from notification previews (manaflow-ai#12030) ceb3030 Keep detached workspace process titles updateable (manaflow-ai#4947) 8be7364 test: kill hosted test shells before freeing their terminals (manaflow-ai#14957) da291df cmux-tui: do not query the host terminal when the reply cannot be read (manaflow-ai#12419) 98767c8 ci: keep earlier reviewed CLA policies valid for branches behind main (manaflow-ai#15008) 7167b77 feat(custom-sidebars): fixedSize and reactive frame specs for JS sidebars (manaflow-ai#14845) 716bbb5 Fix notification hook descriptor inheritance (manaflow-ai#11649) 03b191d cmux-tui: pass the zig target on a native windows-gnu host (manaflow-ai#12416) c9a6a0e docs: load the deep review protocol only when needed (manaflow-ai#15007) e5af879 Match pane indicator strokes and the file path header to shared chrome metrics (manaflow-ai#14982) 0def9e1 Show one fixed subtitle for each Settings row and fix localized labels (manaflow-ai#14883) 1921636 ci: route picker-less macOS lanes to the owned minis for trusted events (manaflow-ai#14794) # Conflicts: # .github/workflows/app-host-test-rerun.yml # .github/workflows/auth-refresh-tests.yml # .github/workflows/ci-health-report.yml # .github/workflows/ci-macos.yml # .github/workflows/ci-owned-pool-rescue.yml # .github/workflows/ci-repo-variables.yml # .github/workflows/cloud-command-deadlines.yml # .github/workflows/cloud-machine-tests.yml # .github/workflows/cloud-task-local-tests.yml # .github/workflows/cmux-tui.yml # .github/workflows/iroh-v2.yml # .github/workflows/relay-tls.yml # .github/workflows/reload-build.yml # .github/workflows/remote-daemon.yml # .github/workflows/resolve-dispatch-ref.yml # .github/workflows/terminal-hang-diagnostics.yml
Several app-host tests freed a live terminal with a bare
releaseSurfaceForTesting()orteardownSurface(). When the free starts while/usr/bin/loginis still in its SIGHUP-ignoring startup, it waits out Ghostty's 12 s SIGHUP grace. The release helper waits synchronously on the main thread, andteardownSurface()waits while holding one ofTerminalSurfaceRuntimeTeardownCoordinator's two close slots. The stall then lands on whichever test runs next. Onmainit hits a different test in each run, for examplehiddenEntryNeverPublishes()ortestSearchOverlayMountsAndUnmountsWithSearchState, at about 12.1 s each.These call sites now go through
releaseHostedSurfaceForTesting()or a newteardownHostedSurfaceForTesting(), which SIGKILL the terminal's processes before freeing. Both are just the plain call when no runtime exists. Covered call sites includeTerminalPortalGeometryFixture.close(),GhosttySurfaceOverlayTests.tearDown,TerminalOffscreenStartupTests, and 17 other test files.CloudRestoreReplayFixturekeepsteardownSurface()because its manual-IO surface has no shell. Test-only change; product teardown and the 12 s grace for real sessions are untouched.Testing
Focused runs of the same three suites on the owned Mac mini lane (
glaeda-std-xcode-26.6):main6431ac2 (run)TerminalWindowPortalCommittedGeometryTests(11 tests)GhosttySurfaceOverlayTests(22 tests)TerminalOffscreenStartupTests(29 tests)All 51 tests passed in both runs. The after run's first attempt never started a test: XCTest hung before connecting to testmanagerd on that host, and a rerun of the failed job passed. These numbers cover only these suites. I did not measure a full app-host shard.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes intermittent ~12 s stalls in the app-host test suites by killing each hosted terminal's shell before freeing its terminal.
Test teardown exits now go through
releaseHostedSurfaceForTesting()or the newteardownHostedSurfaceForTesting(), which SIGKILL the terminal's processes before the native free. Previously, with/usr/bin/loginstill in its SIGHUP-ignoring startup, the free waited out Ghostty's 12 s SIGHUP grace and stalled whichever test ran next. Both helpers fall back to the plain call when no runtime exists.CloudRestoreReplayFixtureandScrollbackTestTerminalkeep bareteardownSurface()because their manual-mirror surfaces have no shell and would spin the 1 s kill deadline doing nothing. Product teardown is unchanged.Written for commit 7f82ed9. Summary will update on new commits.
Summary by CodeRabbit