Skip to content

test(layout-owner): run the SSH Docker orcad specs in the switch-on lane - #52103

Merged
Jinwoo-H merged 16 commits into
layout-owner-v2from
layout-owner-ssh-orcad-lane
Nov 29, 2026
Merged

Jinwoo-H merged 16 commits into
layout-owner-v2from
layout-owner-ssh-orcad-lane

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

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.

Files Added Deleted Net
Test 55 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8248 $\color{#cf222e}{\Huge{\mathbf{−}}}$​23 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8225
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​97 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​95

Before / after

  • Before: no CI ran any SSH-on-orcad journey with the new layout path (census row C5 was "unmeasured").
  • After: every PR into layout-owner-v2 runs 34 SSH journey specs against a real Docker SSH host, in 3 shards, with ORCA_LAYOUT_OWNER=main and ORCA_SERVER_LAYOUT_OWNER=main. Adding the ssh-switch-off-baseline label to a PR also runs a switch-off leg for comparison.

What the lane found (run 46215992851, before the known-failure marks)

  • Main regression, fixed separately in fix(orcad): an SSH host launch no longer deletes its own PID file #52191 (merged): the SSH host launch deleted its own PID file, so every connect to a fresh host failed with "Orca couldn't start its server on this host", in both modes. This branch carries the same fix.
  • Switch-off: 59 specs, 2 failures, both test drift (fixed here). Today's close dialog copy is "Stop the running command?" / "Stop and close", and the "Add a setup script" prompt now covers the managed sidebar row.
  • Switch-on: 14 failures that switch-off doesn't have:
    • C5-L312: keys typed into a fresh terminal never reach its shell. The pane ends at an empty prompt and the typed line never appears, even after 60 s. It is a race, not a fixed set of specs, and probably not specific to SSH: in run 46215992851, terminal-root-owner lost keys in a local desktop terminal opened from File Explorer before it reached the SSH workspace; network-outage lost them in the silent case while the reset case ran identical lines and passed; update-anyway lost 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.
    • C5-L310 (2 specs): an unsaved editor draft is replaced by the file on disk after conversion to a managed server (inline and large drafts).
    • How they're marked: never the whole test, and only with the switch on. L312 is forgiven only on the answer to the first command typed into a terminal the spec just opened, at sites that opt in, and only when the pane still holds nothing but its single initial prompt (no echoed input, no output). After a reconnect, relaunch, update or sleep, failures stay red. L310 is forgiven only when the editor shows exactly the host file's text. Then the test ends as skipped with the row in its annotation. Any other error still fails, including setup, conversion and the switch proof. L312 passing is fine (it's a race); L310 passing fails the test, so a fix drops the mark.
  • C5-L315 (browser tab lost on reconnect): not reproduced. ssh-orcad-browser-routing passes switch-on.

Mechanism

  • Specs and their helpers come from the 11-16 tree, with imports fitted to moved modules. Three were left out: the Windows CLI matrix (needs Windows hosts) and the two legacy-relay specs (need the released-relay harness, which no longer exists).
  • The host's orcad inherits its SSH session's environment, so the Docker host adds SetEnv ORCA_SERVER_LAYOUT_OWNER=<value> to sshd when the runner has the setting. After conversion, the specs ask the host's orcad for status.get and fail if its capabilities show a different layout path than the one requested.
  • The job builds the linux-x64-glibc orcad template while the window leg builds the app, then reuses that build as soon as it's uploaded.
  • On failure, a spec prints the host's server files (log, readiness, PID markers, slot listing, processes) and forwards app logs.
  • Each desktop and host orcad logs the layout path it took, and with the switch on the job checks them (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.
  • The server setting is validated before it goes into the host's shell. Every Docker host and volume is removed in its own finally, so a setup or teardown error can't leak it.

How it was tested

  • pnpm typecheck:e2e and the ratchets pass locally.
  • The lane's CI runs above, switch-on and switch-off.

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).

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.
@Jinwoo-H Jinwoo-H added the ssh-switch-off-baseline Adds a switch-off leg to the layout-owner SSH lane label Nov 29, 2026
@greptile-apps

greptile-apps Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The latest changes appear safe to merge; the five earlier non-blocking findings remain outstanding.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The latest changes appear safe to merge; the five earlier non-blocking findings remain outstanding.

Findings

  1. P2 Phone journey always skips ▶
  2. P2 Comparison label starts nothing ▶
  3. P2 Fresh connections skip path checks ▶
  4. P2 Electron logs appear twice ▶
  5. P2 Dead terminals pass the test ▶

Summary

Restores Docker SSH journeys to the layout-owner lane and checks the layout setting on desktop and host servers.

  • CI runs SSH-orcad workspace journeys with the layout-owner path switched on.
  • Remote orcad launches keep the PID marker for the new server.

Reviews (14) · Last reviewed commit: "test(layout-owner): fix SSH lane CI: no ..." · Reviewed by Greptile

Comment on lines +21 to +24
test.skip(
!SIDEBAR_INPUTS_BUILD,
'the phone reads the feed only in an ORCA_SIDEBAR_INPUTS=main build'
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Phone journey always skips

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"]') }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Comment on lines +130 to +134
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 }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Electron logs appear twice

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.

}

function sleeping(host: OrcadConvertHost, marker: string): boolean {
return host.exec!(`pgrep -f "sleep ${marker}" >/dev/null && echo yes || echo no`).trim() === 'yes'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Dead terminals pass the test

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.

Suggested change
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.
…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
@Jinwoo-H
Jinwoo-H merged commit 102a7c9 into layout-owner-v2 Nov 29, 2026
75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ssh-switch-off-baseline Adds a switch-off leg to the layout-owner SSH lane

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant