Repository navigation
test: repair session-restore, CLI, shell, and Cloud placement app-host tests - #13657
Conversation
aDetachedTerminalDropsItsStaleTabBeforeMoving installs a daemon graph since c402b9c (manaflow-ai#13403). When the placement lane drains it reconciles against that graph, which predates the projected tab, and clears tab_projected. The real reply always carries a mutation cursor (CmuxTuiSnapshotParser.placedTab requires one) that fences exactly this; the fake returned none. Give the fake a projectCursor and set it ahead of the installed graph. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
manaflow-ai#13196 made SurfaceCatalog.validateOwnership refuse a destination the app cannot resolve, so SurfaceCatalog.shared no longer relinked a restored projection into a TabManager that no main window owns. Register it for the test body with LiveWorkspaceFixture.withAppRegistration, as manaflow-ai#13651 does for CloudClosedPanelRestoreTests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Since manaflow-ai#8442, a relay prompt also reports shell state. Both RPCs run in separate background children, and the zsh prompt-refresh test waited only until the log was non-empty, so it could read report_shell_state alone. Wait (deadline-bounded) for the ports_kick line itself, in the zsh test and its bash sibling. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The expect wrapper watches the first two seconds after sending the password for a rejection with log_user 0. A session that authenticates and exits inside that window hit the eof branch and its output was dropped. Flush the buffered output before exiting. manaflow-ai#13207 replaced the test's 9 s sleep with a FIFO release, which is what exposed this. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
4120e35 taught runVMDev that invalid input never connects: keep the listener open, then check its backlog after the CLI exits. manaflow-ai#13207 dropped that again, so each rejected run waited 60 s for a mock-server expectation that only the listener closing (after the wait) fulfills. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The pty case read the master only after the CLI exited. A pty's output queue holds about 1 KiB and the host-key failure report is longer, so the CLI blocked writing stderr until the 30 s timeout. Read the master on a thread while the CLI runs. The test starts its own sshd; no runner host dependency is involved. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
f7132b3
into
manaflow-ai:fix/app-host-green
App-host repairs for the terminal/session/CLI/shell group, into
fix/app-host-green(#13643). Failures are from #13403's CI run 35688876556.Fixed
CloudPlacementCoordinator aDetachedTerminalDropsItsStaleTabBeforeMoving: test bug. c402b9c (Repair main's full macOS suite: package test compile and app-host regressions #13403) made the test install a daemon graph. When the placement lane drains, it reconciles against that graph, which predates the projected tab, and clearstab_projected. The real projection reply always carries a mutation cursor (CmuxTuiSnapshotParser.placedTabrequires one), and that cursor fences this reconcile. The fake provider returned no cursor. It now takes aprojectCursor, and the test sets it ahead of the installed graph.TabManagerSessionSnapshotTests.testSessionSnapshotPersistsRemoteSurfaceProjectionsAndRestoreRelinksThem: stale test. After Fix Cloud display ownership and connection readiness #13196,validateOwnershiprefuses a workspace the app can't resolve. The test now registers the restored TabManager withLiveWorkspaceFixture.withAppRegistration, the same fix test: give Cloud catalog tests live destination workspaces #13651 uses.ZshShellIntegrationHandoffTests.testShellIntegrationRelayPromptRefreshUsesRefreshReasonInZsh: test bug. Since Add first-class Mosh transport for remote workspaces #8442, precmd also sendsreport_shell_state, from a separate background child. The test waited only until the log was non-empty, so it could see that line alone. It now waits, with a deadline, for theports_kickline itself. The bash sibling test gets the same fix.CLINotifyProcessIntegrationRegressionTests.testDefaultFreestyleSSHAttachRelaysAfterDelayedSuccessfulCredential: product bug. For the first 2 s after sending the password, the expect wrapper watches for a rejection withlog_user 0. A session that authenticates and exits inside that window hits theeofbranch, and its output was dropped. The CLI now flushesexpect_out(buffer)before it exits. Fix CLI notify integration regression tests #13207 replaced the test'ssleep 9with a FIFO release, which is what exposed the bug.CLINotifyProcessIntegrationRegressionTests.testVMDevRejectsBadInputBeforeAnyRequest: test regression. Fix CLI notify integration regression tests #13207 dropped 4120e35'sexpectsSocketConnection: falsepath. Each rejected run then waited 60 s on a mock expectation that only the listener closing fulfills, and the listener closes after the wait. That path is restored: the listener stays open and its backlog is checked with a non-blocking accept after the CLI exits.Cloud SCP with OpenSSH transferUsesRealSFTPAndChecksTheHostKey: test bug, not a host dependency. The test starts its own/usr/sbin/sshd, and every other scenario passed on the runner. The terminal case (Fix idle Cloud SCP watches and report local transfer failures #12759) read the pty master only after the CLI exited. A pty holds about 1 KiB, the host-key failure report is longer, and the CLI blocked on stderr until the 30 s timeout. A thread now drains the master while the CLI runs.Already fixed by #13651:
"Restoring a Cloud terminal reserves a manual mirror instead of a local shell".Not failing in the latest run: CloudManualMirrorPresentation, CloudManualMirrorTransport, CloudNativeLayoutProjection, CmuxTuiSurfaceProviderRegistryPolling.
Left open: these need an app-host run to diagnose, and there's no evidence yet for a fix.
offPlanGeometryWithUnchangedSizingInputsReconverges: fails every run (%1 plan=320x450 view=511x450,rearms=3). All three recovery passes re-impose the extent, but the bonsplit divider stays at the perturbed 0.8. The mirror code hasn't changed since July. The last bonsplit bump was Prevent terminal flicker and delayed nested layout on workspace switches #12310 (faf8418, newresizeSubviewsWithOldSize).workspaceRevealKeepsTerminalSizeUntilAnUnchangedGeometryPass: flaky. It passed in 35666501009 and failed in 35688876556: the final resize to 360 never published a smaller native size within 5 s.WorkspaceTerminalFocusRecoveryTests.testTerminalFirstResponderFeedbackPreservesActiveFocusTransaction: fails every run. The surface never becomes first responder. Other focus suites show the same symptom: WorkspaceTerminalFocusRecoverySwiftTests and TerminalNotificationDirectInteractionTests.swiftc -parsepasses on every changed Swift file.check-test-determinism.py --strictandlint-pbxproj-test-wiring.share clean. The expecteofflush was reproduced and verified locally with/usr/bin/expect, and the pty drain with a 20 KB writer.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Repairs app-host test failures across session-restore, CLI, shell, and Cloud placement, and fixes a CLI bug where an SSH session that authenticated and exited right away dropped its output.
Bug Fixes
expect_out(buffer)oneofbefore exiting, so a session that authenticates and ends inside the two-second rejection watch still prints its output.Test Fixes
surface.ports_kickline itself instead of any relay line.vm devinput test keeps the listener open and checks its backlog after the CLI exits, instead of waiting on a mock expectation that only closes after the timeout.Written for commit bafd6c3. Summary will update on new commits.