You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: extract the duplicated subprocess crash harness into tests/common #327
tests/wal_test.rs and tests/migration_matrix_test.rs contain byte-identical copies of the subprocess crash-simulation harness — roughly 120 lines: CRASH_CHILD_SPAWN_LOCK, CrashTx, run_crashing_child, and crash_child_entrypoint.
Background
The harness arrived with the kernel-locking work. std::mem::forget stopped modelling a crash once the lock moved into the kernel: forgetting the handle leaks the File, so its descriptor stays open and the lock is held for the whole life of the test process. The replacement spawns a real child that opens, writes, and abort()s, which is what production actually does.
Integration test crates cannot share code directly, so the harness was duplicated deliberately rather than carelessly. The tell that it is now a liability is #[allow(dead_code)] on CrashTx::Explicit in migration_matrix_test.rs — a variant that exists there only because it was copied.
Why it matters
Someone fixes a defect in one copy and not the other — the status.code().unwrap_or(1) predicate, say, or the \u{1e} statement separator — and the two crash harnesses silently diverge. One test file then stops testing what its comments claim, with nothing failing to signal it.
Task
Extract the harness into tests/common/mod.rs
Have both files mod common;
Drop the now-unnecessary #[allow(dead_code)]
Confirm both suites stay green under default parallelism
Not urgent: both copies are currently correct and this is test-only. It should not be left indefinitely.
Activity
test: extract duplicated subprocess crash harness into tests/common (#…