Leave no temporary directories behind in the test suites #19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/ram-29-test-temp-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of RAM-29 (the card stays open: the shared fixtures it asks for are still to come).
Running the suite left one directory per CLI test, per configuration test, and per daemon state-file test in the temporary directory. Repeated runs had to be cleaned by hand, and a stale socket from an earlier run can be mistaken for a live daemon, so this was a defect rather than untidiness.
What this changes
Each test directory now has an owner that removes it when the test ends:
cli_contract.rs: the socket path is aTestSocketthat derefs toPath(so every call site is unchanged) and removes its directory on drop.host_config.rs: aTempDirguard, one per test.daemon.rstests: aTempDirguard, replacing the directory that was only removed at the end of the test, and only on the happy path.Verification
cargo fmt --all --checkclean,cargo clippy --workspace --all-targets -- -D warningsclean,cargo test --workspace388 passed, 0 failed.The fix is verified by measuring it rather than by reading it: with
/tmp/breadram*cleared first, the whole suite now leaves 0 entries behind, where the CLI suite alone previously left one directory per test per run.docs/AGENT-HANDOFF.mdno longer lists the leak, and says what is still open on RAM-29 instead: the shared replay and integration fixtures do not exist yet, so each suite builds its own.