-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Problem
The orchestrator uses a fixed base directory (/tmp/first) and deterministic subdirectories (run_N).
Code reference:
https://github.com/siphonite/first/blob/main/src/orchestrator.rs#L13
const FIRST_BASE_DIR: &str = "/tmp/first";https://github.com/siphonite/first/blob/main/src/orchestrator.rs#L46
let work_dir = PathBuf::from(FIRST_BASE_DIR).join(format!("run_{}", target));When cargo test runs tests in parallel (the default behavior), multiple FIRST tests will attempt to read/write to /tmp/first/run_N concurrently.
Impact
- Cross-test filesystem corruption: One test's cleanup might delete another test's active directory.
- Nondeterministic failures: Tests might fail sporadically depending on thread scheduling.
- False positives/negatives: A test might pass because another test set up the state it expected, or fail because another test clobbered it.
- Unsafe for default cargo test usage: Users must run with
--test-threads=1to avoid this, which is not obvious.
Acceptance Criteria
- Each FIRST test invocation uses a globally unique base directory.
- Examples of unique identifiers: UUID, PID + timestamp, or hash(test_name + PID).
- Use
std::env::temp_dir()instead of hardcoding/tmpto respect OS conventions. - No shared filesystem paths across concurrent tests.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working