mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-07 00:24:50 +08:00
Stabilize plugin lifecycle temp dirs across parallel tests
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user