Skip to content

Some tests use manual temp dir cleanup instead of tempfile::TempDir RAII #403

@karthiknadig

Description

@karthiknadig

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions