Relationships
#4628 Test broken on main: SqliteReadModel.recover full_recovery_required case merges into a directory that does not exist (found by #4612)
Opened by zack · 11/11/2026· Shipped 11/11/2026
What fails
On a clean checkout of main at 1fb5c4c1e, this test fails every run on Linux:
src/infrastructure/datastore_v3/sqlite_read_model_test.ts SqliteReadModel.recover: a recovery asked to be targeted runs in full and says why: full_recovery_required (5, swamp-club#4581)
error: TypeError: the source path is neither a regular file nor a symlink to a regular file: copy '/repo/moved/data' -> '/repo/elsewhere/data'
It also fails verify-build's run-tests step for any branch rebased onto current main (found while verifying swamp-club#4612).
Why
The full_recovery_required case's arrange writes moved/data/x, then calls mergeDirInto(moved, join(repoDir, "elsewhere")) without creating elsewhere. In mergeDirInto (src/infrastructure/persistence/directory_merge.ts), the destination entry does not exist, so it tries Deno.rename into the missing parent, which fails, and then falls back to Deno.copyFile on the data directory, which throws.
Likely fix
Create the destination before merging in the test's arrange (Deno.mkdir with recursive true on the elsewhere path), or have the arrange use a destination that exists. mergeDirInto itself has always required an existing destination; whether it should create one is a separate question.
Reproduce
deno run test src/infrastructure/datastore_v3/sqlite_read_model_test.ts (107 passed, 1 failed)
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.