Repository navigation
test(wsl-mover): prove an update install is held during a real move - #35345
Conversation
…nd proceeds after it settles
|
STATUS: ready. Head 8a57edc, from origin/main 7b3fb54. Test-only: the real updater install path against a real move-driver run over the kill rig. The install is held with its message while the move runs, and the same staged update installs after the move is moved, refused (host gone), cancelled, or killed mid-run and recovered on relaunch. All 4 tests fail with the hold disabled. Checks: pnpm tc, typecheck:ci, code-quality, anti-slop, oxlint, ast-grep scan, flaky-test filter and gates; 3 repeat runs green. Review requested from fix-reviewer. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 20 minutes. View limit details
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 |
[Low impact] The PR's effects stay inside automated tests. This test-only change is safe to merge, with a non-blocking gap in the crash recovery test. Findings
SummaryAdds four tests that join the updater harness to the real WSL move driver.
Reviews (1) · Last reviewed commit: "test(wsl-mover): prove an update install..." · Reviewed by Greptile |
| // Killed at the pause, after the move has journaled its cutover. | ||
| staged.mover.rig.kill.killAt = 'sleep' |
There was a problem hiding this comment.
The sleep kill point fires before the move writes its journal. The driver turns that error into a refusal, then releases the running move in finally. Recovery has nothing to settle, so this test passes even if journal recovery does nothing.
Use a kill point after journaling, assert that an unfinished journal exists before restart, and check its expected result afterward.
Knowledge Base Used: Desktop persistence and lifecycle
ELI5
#34813 makes Orca refuse to install an app update while a project is moving into a WSL host, because installing quits the app mid-move. We can't prove that on the shared Windows test box, where real update prompts are never accepted. This adds an automated test that runs the real update-install code against a real project move, and checks both the hold and that the update installs once the move is over.
What Changed
Test-only. A new file,
src/main/updater.wsl-move-install-hold-driver.test.ts, joins two existing harnesses:createUpdaterMocks, used byupdater.wsl-move-install-hold.test.ts): a fake auto-updater with a downloaded, staged update and an interactive install.createWslMoveKillRig, used by the fault-injection tests): the real move drivermoveProjectsToWslHost, run against a real orcad profile store standing in for the host, with the real cutover journal and a kill switch.The move is paused where it reaches for the host, so it is genuinely in flight when Install is pressed. Each test then checks:
quitAndInstall, no terminals are killed, the window getsupdater:quitAndInstallAborted, the status card shows "A project is moving to its WSL host. Install the update once the move finishes." with an Install retry, and thequit_and_install_held_for_wsl_movelifecycle record is written.quitAndInstallonce; only the earlier attempt was aborted). That is checked for four endings:moved)refused)wsl_move_cancelled)Why
The existing test from #34813 claims the running-moves registry directly. It proves the install path reads the registry, but not that a real move run claims it while in flight and releases it on every way a run can end. This test drives the real driver, so a run that forgot to release, or released too early, fails it. With the hold disabled, all four tests fail.
Why not e2e:
wslMove:*handlers with a scripted host, so no real driver runs.The integration level is the highest that runs both for real. The test loads the move modules after the updater harness resets modules, so both read one running-moves registry.
Flag-off: test-only. The test turns the WSL hosts gate on itself; nothing ships.
User-risk: none (no production code changes).
Linked Issue
Follow-up to #34813 (CI proof for the update-during-move hold, which awin can't exercise).
Visual Proof
N/A. Test-only.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
The new file: 4 tests. It passes 3 runs in a row, together with
updater.wsl-move-install-hold.test.tsandwsl-move-driver-fault-injection.test.ts(9 tests per run).Mutation check: with the hold condition disabled in
updater-install-execution.ts, all 4 fail.Checks run:
pnpm tc,pnpm run typecheck:ci,pnpm run check:code-quality:changed, anti-slop oxlint, oxlint, ast-grep scan, the flaky-test filter and gates. The test never sleeps in real time: the updater runs on fake timers, and the move is paused on a promise.Review
Agent skill upstream boundary
Notes
Status
Ready for review.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)