Skip to content

test: extract duplicated subprocess crash harness into tests/common - #336

Merged
adityamukho merged 1 commit into
mainfrom
worktree-issue-327-crash-harness
Aug 23, 2026
Merged

adityamukho merged 1 commit into
mainfrom
worktree-issue-327-crash-harness

Conversation

@adityamukho

Copy link
Copy Markdown
Collaborator

Summary

  • wal_test.rs and migration_matrix_test.rs carried byte-identical copies of the subprocess crash-simulation harness (CRASH_CHILD_SPAWN_LOCK, CrashTx, run_crashing_child, crash_child_entrypoint) — extracted into tests/common/mod.rs, both files now mod common;
  • The #[allow(dead_code)] on CrashTx::Explicit moves to its single definition site in tests/common/mod.rs, since migration_matrix_test's binary still never constructs that variant (each integration test binary compiles tests/common/mod.rs separately, so this isn't avoidable — but now there's one annotation instead of a stray copy)
  • The child-process dispatch name changes from "crash_child_entrypoint" to "common::crash_child_entrypoint" to match the function's new module path

Closes #327

Test plan

  • cargo test --test wal_test --test migration_matrix_test — 28 tests pass under default parallelism
  • cargo build --tests — no warnings from either file
  • cargo clippy --all-features -- -D warnings (matches CI) — clean
  • cargo test (full suite) — all green

🤖 Generated with Claude Code

https://claude.ai/code/session_01YMWSutMLJJ7Y5b8hs9ZaCU

…327)

wal_test.rs and migration_matrix_test.rs carried byte-identical copies of
the crash-simulation harness (CRASH_CHILD_SPAWN_LOCK, CrashTx,
run_crashing_child, crash_child_entrypoint). Moved into tests/common/mod.rs
so there's a single source of truth; both files now `mod common;`.

Each integration test binary still compiles tests/common/mod.rs
separately, so the child-process dispatch name changes from
"crash_child_entrypoint" to "common::crash_child_entrypoint". The
#[allow(dead_code)] on CrashTx::Explicit moves to its one definition site,
since migration_matrix_test's binary still never constructs that variant.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YMWSutMLJJ7Y5b8hs9ZaCU
@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho merged commit 05996a9 into main Aug 23, 2026
17 checks passed
@adityamukho
adityamukho deleted the worktree-issue-327-crash-harness branch August 23, 2026 06:04
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.

test: extract the duplicated subprocess crash harness into tests/common

1 participant