Skip to content

Stop deterministic test directory allocation from deleting colliding roots #717

Description

@flyingrobots

Defect

Two deterministic filesystem-test allocators treat an existing candidate directory as disposable:

  • crates/warp-core/src/causal_wal_tests.rs::deterministic_test_dir
  • crates/warp-core/tests/causal_wal_hardening_tests.rs::temp_wal_root

On AlreadyExists, each calls remove_dir_all and recreates the path. The counter that chooses the suffix is process-local while the target directory is shared. Two overlapping test processes can therefore select the same candidate, and one process can delete the other process's live fixture.

The destructive collision behavior is present in the current code. A cross-process executable witness is still required before repair.

Acceptance

  • Add a RED independent-process witness: process B owns a candidate directory and marker; process A collides with that candidate and must not remove, replace, or mutate B's material.
  • An allocator claims only a path it created atomically.
  • AlreadyExists never authorizes remove_dir_all without exact ownership evidence.
  • Stale-fixture reclamation, if retained, is a separate bounded operation with an ownership marker and exact-root aperture.
  • Parallel and overlapping test invocations cannot delete one another's fixtures.
  • Preserve deterministic test naming where it remains useful; do not widen this into production filesystem authority.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogBacklog (not current milestone)bad-codeKnown code smell or defect filed for laterlane:bad-codeMethod lane bad-code.legend:testMethod legend test.needs-witnessMethod closeout state needs-witness.priority:mediumMethod priority medium.toolingTooling/CI/CLItype:bugMethod work type bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions