Skip to content

test(wsl-mover): crash a WSL move at every step and prove it ends at zero or fully moved - #29826

Closed
nwparker wants to merge 1 commit into
nwparker/wsl-move-reset-to-zerofrom
nwparker/wsl-move-fault-injection
Closed

nwparker wants to merge 1 commit into
nwparker/wsl-move-reset-to-zerofrom
nwparker/wsl-move-fault-injection

Conversation

@nwparker

@nwparker nwparker commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​365 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​365
Prod 0 0 0 0

Test only, stacked on #29825. It merges after #29825, and it changes no product code.

Summary

A fault-injection test that crashes a WSL project move at every step and proves each crash ends in one of two states: back where it started, or fully moved.

Before / after

Before, nothing exercised a move as a whole under crashes. After, the test runs a move through the real journal, fence, session freeze and desktop rewrite driver. It uses a fake host catalog and fake rewrite stores, because the end-to-end move driver isn't wired yet. It crashes at each of 25 points, then restarts and runs recovery twice: once with the host unreachable and once with it answering.

Crash point Host down Host up
journal prepared … blobs-transferred written, quiesce, stage (before, or after with the reply lost), blob transfer back at zero back at zero
blobs-transferred written, commit request not yet landed waiting for host back at zero
commit landed but its reply lost; destination-committed about to be written waiting for host fully moved
destination-committed written; each rewrite store's run or flush; retained about to be written fully moved fully moved

After every back-at-zero case, a fresh move of the same project completes. With the recovery from #29825 removed, the first crash point already ends stuck, which is today's behavior on main.

Mechanism

  • A test-only move sequence follows the driver contract: commit only from blobs-transferred.
  • Every journal write, host mutation and store step is a crash point.
  • The host fake applies each mutation before its reply can be "lost", so lost replies are covered.

Why this approach

It proves the owner's "reset to zero and move again" model against the pieces that exist today, before the move driver is wired.

Testing

vitest src/main/persistence/moving-wsl-projects/wsl-move-reset-fault-injection.test.ts: 2 tests, 25 crash points. The test has a 60 s timeout because it runs about 25 whole moves on disk.

@nwparker

Copy link
Copy Markdown
Contributor Author

CI note: this PR is based on #29825's branch, so CI skipped the unit-test jobs and the harness hasn't run in CI yet. Locally it passes all 25 crash points (vitest src/main/persistence/moving-wsl-projects/wsl-move-reset-fault-injection.test.ts). Suggested path: land it after #29825, retargeted to main so its tests run, or fold it into #29825.

@nwparker
nwparker force-pushed the nwparker/wsl-move-reset-to-zero branch from 315654c to 8470999 Compare October 20, 2026 21:22
@nwparker
nwparker force-pushed the nwparker/wsl-move-fault-injection branch 2 times, most recently from 85a9ef5 to b4988c2 Compare October 20, 2026 21:37
@nwparker

Copy link
Copy Markdown
Contributor Author

Restacked on the rebased #29825, with a new case. The whole 25-point crash matrix now also runs against a host that refuses the manifest inline at recovery. Every point still ends back at zero or fully moved, through abortByReference. Locally, all 248 mover tests pass. CI still skips unit tests on this stacked PR.

@nwparker
nwparker force-pushed the nwparker/wsl-move-fault-injection branch from b4988c2 to a411fc1 Compare October 20, 2026 21:47
@nwparker

Copy link
Copy Markdown
Contributor Author

CI: all green on head a411fc13, with one job re-run. On the first run, unit shard 4/5 failed in src/main/daemon/daemon-stream-backpressure-socket.test.ts ("bounds 1024-character writes … and resumes"), a daemon socket-timing test this PR doesn't touch; it passed on re-run. Run locally together with the harness in one process, both pass (7/7). The harness touches no daemon, socket or timer code. Ready for owner review once #29825 lands.

@nwparker
nwparker force-pushed the nwparker/wsl-move-fault-injection branch from a411fc1 to 5861541 Compare October 20, 2026 22:44
@nwparker
nwparker force-pushed the nwparker/wsl-move-reset-to-zero branch from 07b5513 to 326cf4f Compare October 20, 2026 23:15
@nwparker
nwparker force-pushed the nwparker/wsl-move-fault-injection branch from 5861541 to 5482c38 Compare October 20, 2026 23:15
@nwparker
nwparker force-pushed the nwparker/wsl-move-reset-to-zero branch from 326cf4f to 50762d2 Compare October 21, 2026 00:44
@nwparker
nwparker force-pushed the nwparker/wsl-move-fault-injection branch from 5482c38 to 2ad1e94 Compare October 21, 2026 00:44
@nwparker

Copy link
Copy Markdown
Contributor Author

CI: all green on 2ad1e9427c8, stacked on #29825, with no re-runs. The harness ran in CI and passed: 25 crash points, plus the case where the host refuses the manifest inline. Lands after #29825.

@nwparker

Copy link
Copy Markdown
Contributor Author

Contained in the dark landing PR #34059 (its head commit is an ancestor of the landing branch). Closing in favour of it; branch kept.

@nwparker nwparker closed this Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant