Repository navigation
test(layout-owner): run the SSH Docker orcad specs in the switch-on lane - #52103
Conversation
Restores the ssh-orcad journeys (cut 11-21) into the layout-owner suite, passes the server setting to the Docker host's orcad through sshd, and checks the orcad took it.
[Medium impact] The latest changes appear safe to merge; the five earlier non-blocking findings remain outstanding. Findings
SummaryRestores Docker SSH journeys to the layout-owner lane and checks the layout setting on desktop and host servers.
Reviews (14) · Last reviewed commit: "test(layout-owner): fix SSH lane CI: no ..." · Reviewed by Greptile |
| test.skip( | ||
| !SIDEBAR_INPUTS_BUILD, | ||
| 'the phone reads the feed only in an ORCA_SIDEBAR_INPUTS=main build' | ||
| ) |
There was a problem hiding this comment.
SIDEBAR_INPUTS_BUILD requires out/main/ORCA_SIDEBAR_INPUTS_MAIN, but the reused window build never enables ORCA_SIDEBAR_INPUTS=main. CI therefore skips this journey on every run. Use a separate feed-enabled build and matching test template so the lane actually checks the phone’s SSH workspace list.
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| owner: ${{ fromJSON(contains(github.event.pull_request.labels.*.name, 'ssh-switch-off-baseline') && '["main","window"]' || '["main"]') }} |
There was a problem hiding this comment.
Comparison label starts nothing
Adding ssh-switch-off-baseline does not start the promised comparison run. The workflow listens for opening, updating, reopening, and marking a PR ready, but adding a label sends a labeled event. Include that event, with a label filter if needed, so authors can request the baseline without pushing another commit.
| const server = connected.managedServer | ||
| if (server?.kind !== 'managed') { | ||
| throw new Error(`expected a managed server, got ${JSON.stringify(server)}`) | ||
| } | ||
| return { targetId: connected.targetId, environmentId: server.environmentId } |
There was a problem hiding this comment.
Fresh connections skip path checks
This helper checks only that the server is managed, not which layout path it took. The capability check runs only through convertAndRetain, so the idle-exit journeys can pass against the old server path in the switch-on job. Call expectManagedServerTookLayoutOwner after fresh connections too. Direct connections in the shared-home and identity-file specs have the same gap.
| ORCA_E2E_RUNTIME_WS_PORT: String(runtimeWsPort) | ||
| } | ||
| }) | ||
| forwardElectronProcessLogs(app, testInfo) |
There was a problem hiding this comment.
createRestartSession().launch() now calls forwardElectronProcessLogs, but the desktop-browser-bridge test still calls it again for the same app. With ORCA_E2E_FORWARD_APP_LOGS=1, both calls add listeners, so every Electron log line and exit message appears twice. This makes CI failures harder to read. Remove the extra call from that test, or make forwarding safe to call twice.
…er-ssh-orcad-lane # Conflicts: # .github/workflows/layout-owner-switch-on.yml
| } | ||
|
|
||
| function sleeping(host: OrcadConvertHost, marker: string): boolean { | ||
| return host.exec!(`pgrep -f "sleep ${marker}" >/dev/null && echo yes || echo no`).trim() === 'yes' |
There was a problem hiding this comment.
sleeping() matches its own shell command. host.exec runs bash -lc with a command containing sleep ${marker}, so pgrep -f finds that shell even if the terminal process has died. Both survival checks can therefore pass without the terminal they claim to protect.
Use [s]leep ${marker}, as the idle-exit test does, so the probe cannot match itself.
| return host.exec!(`pgrep -f "sleep ${marker}" >/dev/null && echo yes || echo no`).trim() === 'yes' | |
| return host.exec!(`pgrep -f "[s]leep ${marker}" >/dev/null && echo yes || echo no`).trim() === 'yes' |
The nohup launch backgrounds its whole && chain, so the PID removal added in #51342 ran in the background and could delete the PID file the foreground had just written. The host's server then read as unverifiable and connect failed. Remove the old PID before the chain instead.
… and both-mode drift
…d setup-script prompt
…tom; prove every desktop and orcad path - Known C5 failures no longer mark whole tests. Only one assertion is forgiven, on the new path, and only when the page shows the row's symptom (C5-L312: the typed line never reached the shell, which ends at an empty prompt; C5-L310: the editor shows the disk file). Any other error still fails. L312 loses a race, so a pass is fine; L310 fails when it passes, so a fix drops the mark. - The job logs each desktop and host orcad's layout path and checks them, as the servers job does; browser-routing proves its orcad too. - The server setting is validated before it reaches the host's shell, and every Docker host and volume is removed in its own finally. - orcad-remote-empty-markers test synced to main's #52191.
…mmand, and C5-L310 only on the exact disk text - Lost-keys forgiveness is opt-in at each first-command site, and only counts when the tab was just opened by openTerminalTab and nothing else has been typed into it; any expectPaneText consumes it. After a reconnect, relaunch, update or sleep, failures stay red. - The symptom is now a pane holding only its single initial prompt: no echoed input and no output, so a command that ran and failed (even a wrapped one) never matches. - hostCliUntilOk forgives only when no attempt ever got an answer. - The draft check forgives only when the editor shows exactly the host file's text. - root-owner's second, managed Open-in-Terminal pane gets the same first-command check.
…ehavior, first-command opt-in for the fault journey
ELI5
SSH workspaces now run on a small Orca server (orcad) that the desktop puts on the SSH host. The layout-owner work had never been tried against that setup, because its tests were cut from the repo on 11-21. This PR brings those tests back into the layout-owner lane and runs them with the new layout path switched on, on both the desktop and the host's server.
Before / after
layout-owner-v2runs 34 SSH journey specs against a real Docker SSH host, in 3 shards, withORCA_LAYOUT_OWNER=mainandORCA_SERVER_LAYOUT_OWNER=main. Adding thessh-switch-off-baselinelabel to a PR also runs a switch-off leg for comparison.What the lane found (run 46215992851, before the known-failure marks)
terminal-root-ownerlost keys in a local desktop terminal opened from File Explorer before it reached the SSH workspace;network-outagelost them in the silent case while the reset case ran identical lines and passed;update-anywaylost them in test 2 while test 1 ran the same setup and passed. Other losers: pairing repair (3), sleep while disconnected, terminal browser link, idle-frame reconnect, unbindable tunnel port, Codex question skip, desktop browser bridge.ssh-orcad-browser-routingpasses switch-on.Mechanism
SetEnv ORCA_SERVER_LAYOUT_OWNER=<value>to sshd when the runner has the setting. After conversion, the specs ask the host's orcad forstatus.getand fail if its capabilities show a different layout path than the one requested.check-layout-owner-processes.mjs desktop,orcad), as the servers job does. 24 specs prove their orcad through the conversion helper;browser-routing, the L315 evidence, now proves its own.finally, so a setup or teardown error can't leak it.How it was tested
pnpm typecheck:e2eand the ratchets pass locally.Visible changes
None (tests and CI only; the PID fix is #52191's).
Performance
None, because this adds tests and a CI job only; no product code changes beyond #52191 (already on main).