-
Notifications
You must be signed in to change notification settings - Fork 38
Some tests use manual temp dir cleanup instead of tempfile::TempDir RAII #403
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
Several new tests added in PR #392 use manual temp directory management (std::env::temp_dir() + timestamp + fs::remove_dir_all in cleanup) instead of the RAII tempfile::TempDir pattern.
Affected Files
crates/pet-pixi/src/lib.rs(line ~112-116)crates/pet-windows-registry/src/lib.rs(line ~149-156)- Other test modules in Improve locator and reporter test coverage #392
Problem
If a test panics before reaching the cleanup code, temp directories are left behind. The RAII approach (already used in crates/pet-uv/src/lib.rs and crates/pet/tests/jsonrpc_server_test.rs) cleans up automatically even on unwind.
Proposed Fix
Replace manual temp dir management with tempfile::TempDir where it isn't already used.
Impact
Minor — leftover temp dirs on CI from panicked tests. Not a correctness issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request