test(raw): ensure CARGO_TARGET_TMPDIR exists in decode_report FixtureDir (#2502)

This commit is contained in:
Dylan M. Taylor
2026-11-19 23:32:07 -05:00
committed by GitHub
parent cfcc86242d
commit f4c242fe21
+1
View File
@@ -18,6 +18,7 @@ struct FixtureDir(PathBuf);
impl FixtureDir {
fn new(test: &str) -> Self {
let root = Path::new(env!("CARGO_TARGET_TMPDIR"));
std::fs::create_dir_all(root).unwrap_or_else(|error| panic!("create tmp root {}: {error}", root.display()));
for attempt in 0..1000 {
let path = root.join(format!("decode-report-{test}-{}-{attempt}", std::process::id()));
// Only clean up a directory this test created, even if a process ID was reused.