Stabilize plugin lifecycle temp dirs across parallel tests

This commit is contained in:
Yeachan-Heo
2026-04-06 01:18:56 +00:00
parent df0908b10e
commit ee92f131b0

View File

@@ -6541,11 +6541,15 @@ mod tests {
}
fn temp_dir() -> PathBuf {
use std::sync::atomic::{AtomicU64, Ordering};
static COUNTER: AtomicU64 = AtomicU64::new(0);
let nanos = SystemTime::now()
.duration_since(UNIX_EPOCH)
.expect("time should be after epoch")
.as_nanos();
std::env::temp_dir().join(format!("rusty-claude-cli-{nanos}"))
let unique = COUNTER.fetch_add(1, Ordering::Relaxed);
std::env::temp_dir().join(format!("rusty-claude-cli-{nanos}-{unique}"))
}
fn git(args: &[&str], cwd: &Path) {