Repository navigation
test(e2e): fake WSL connector reports a stopped distro as distro-stopped, as production does - #34624
Conversation
…ge as distro-stopped Production liveness publishes distro-stopped when a stopped distro loses its bridge; the e2e fake published closed. An explicit disconnect still reports closed.
|
No actionable comments were generated in the recent review.
|
…, and checks nothing booted the distro Main's fake now publishes 'distro-stopped' when it drops a stopped distro's bridge (#34624), as liveness does, so the phone gets "isn't running" and stoppedOnDesktop. The spec also checks distros.json still reads 'stopped' at the end: the fake boots a distro by rewriting it.
…, and checks nothing booted the distro Main's fake now publishes 'distro-stopped' when it drops a stopped distro's bridge (#34624), as liveness does, so the phone gets "isn't running" and stoppedOnDesktop. The spec also checks distros.json still reads 'stopped' at the end: the fake boots a distro by rewriting it.
…, and checks nothing booted the distro Main's fake now publishes 'distro-stopped' when it drops a stopped distro's bridge (#34624), as liveness does, so the phone gets "isn't running" and stoppedOnDesktop. The spec also checks distros.json still reads 'stopped' at the end: the fake boots a distro by rewriting it.
…, and checks nothing booted the distro Main's fake now publishes 'distro-stopped' when it drops a stopped distro's bridge (#34624), as liveness does, so the phone gets "isn't running" and stoppedOnDesktop. The spec also checks distros.json still reads 'stopped' at the end: the fake boots a distro by rewriting it.
…er starts its distro (E6) (#33911) * feat(wsl-host): a paired phone reaches the desktop's WSL host and never starts its distro (E6) Behind ORCA_INTERNAL_WSL_HOSTS and the Experimental switch. The desktop relay lists its WSL hosts to phones. Every relayed call (resolve, call, watchChanges, status.get) passes a never-start check, and a WSL host serves a phone only while it already runs. - WslHostPhoneGate holds the phone's view. The call check reuses E9's focusReachability, so with no bridge in this process it refuses without a running-list read. A host shows as "stopped" only on a confirmed stop (liveness's distro-stopped, or a running list read by the check); anything else gets a neutral "isn't available" message. Hosts are hidden from phones while the Experimental switch is off or a Remove is pending. - The relay host list sends optional `stoppedOnDesktop` only for a confirmed stop. The phone badges those rows "Start on computer"; older peers ignore the field. - The paired-server rows producer carries WSL hosts like any server, so the main-computed sidebar feed a phone reads has their rows. - The paired-phone e2e drives a WSL host project end to end and asserts a stopped distro is never started. * fix(wsl-host): keep the phone's no-start check off non-WSL servers, and a stale stop off a ready host - status.get runs the no-start check only for a WSL host, through a check-only helper. SSH-managed and paired servers reach the status owner exactly as on main: no reconnect, no redeploy, and the manual-disconnect, coalescing and repair handling stay in place. The preparation option is stripped before the probe. - WslHostPhoneGate drops a 'stopped' read when a ready status arrived while it ran (a per-host ready generation), and clears a recorded stop when a check finds the host answering. - A phone asking about a host that is switched off or being removed gets copy that says so, not "open one of its projects". * test(wsl-host): the real no-start helper leaves SSH-managed and paired servers untouched * fix(wsl-host): tie a phone's confirmed WSL stop to that host's status, and label a host not connected - A stop a phone's check confirmed is stored with that host's own status object and holds only while that status is current. Another host's change no longer clears it. Any status of its own (ready, a disable's closed, a failed Remove's closed) does. A read never records a stop over a ready status, so a read shared with one begun before ready can't. Removed hosts drop their entry. The generation map and status listener are gone. - The relay sends optional `unavailableOnDesktop` for a WSL host this desktop isn't connected to and doesn't know is stopped. New phones badge it "Open on computer"; older ones still show Connecting. - The relay list reads the WSL host records once per poll (reachAll). * refactor(wsl-host): one records read per phone check; note the gate's status identity compare * test(wsl-host): read the phone's host flags as booleans in the paired-phone e2e toMatchObject({ stoppedOnDesktop: undefined }) requires the key to be present, and the desktop omits an unset flag, so the ready poll could never match. The poll now compares relay plus both flags read as booleans. * test(wsl-host): expect the neutral refusal once main's fake drops a stopped distro's bridge as closed Main's fake connector (#34573) now publishes 'closed' when a stopped distro's bridge drops, not liveness's 'distro-stopped'. So the phone's check reads the stop under a ready status and doesn't claim it. The phone gets the neutral copy and unavailableOnDesktop; the confirmed-stop copy stays unit-tested. * test(wsl-host): the paired-phone e2e expects the confirmed stop again, and checks nothing booted the distro Main's fake now publishes 'distro-stopped' when it drops a stopped distro's bridge (#34624), as liveness does, so the phone gets "isn't running" and stoppedOnDesktop. The spec also checks distros.json still reads 'stopped' at the end: the fake boots a distro by rewriting it. * test(wsl-host): the startup reconcile suite stubs the phone gate built beside the service The reconcile still runs before the connector exists; the suite only lacked the new setWslHostPhoneGate export on its service-instance mock. Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
ELI5
The e2e tests use a fake WSL connection, so they can run on any CI machine. When a fake distro was stopped, the fake reported the connection as merely "closed". The real app reports "distro stopped" in that case. Now the fake matches. Only the e2e fake changes.
What Changed
src/main/wsl/wsl-host-e2e-fake-connector.tsis reachable only underORCA_E2E_FAKE_WSL_HOSTS.reachability()found a fake distro markedstopped, it dropped the bridge and published{ state: 'closed' }.{ state: 'distro-stopped', terminals: 'exited', recovering: false }, the same status production liveness publishes when a distro stops (WslOrcadLivenessSupervisor.onDistroStopped).disconnect()of a running distro still publishesclosed.So, as in production, the host service now records the stopped host as parked off this status, and the UI shows a stopped distro's wording rather than a generic closed one.
Why
The fake should exercise the same status path production does, so e2e results carry over to the real connector. Neither
tests/e2e/wsl-host-chat.spec.tsnortests/e2e/wsl-host-fake-transport.spec.tsasserts onclosed. The chat spec's "Ubuntu was stopped" refusal comes from the same parked path either way.Follow-up enabled: #33911's paired-phone e2e can go back to asserting the "isn't running" wording for a stopped distro once this lands.
Linked Issue
N/A (e2e fidelity).
Visual Proof
N/A: e2e fake only.
Testing
wsl-host-e2e-fake-connector.test.ts:distro-stopped;closedfor an explicit disconnect.Ran
wsl-host-chat.spec.tsandwsl-host-fake-transport.spec.tslocally, hidden (ORCA_BACKGROUND_LAUNCH=1): 2 passed and 2 failed. The failures are at the same lines (chat :170 project focus, fake-transport :351 runtime route) both with and without this change, before either spec stops a distro, so they are local and unrelated. CI runs both specs through the route-contracts selection.pnpm tc:node, oxlint, the anti-slop lint and the changed-code gate pass.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
Notes
E2E-only. There's no production, SSH, mobile or wire impact.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)