Skip to content

Code graph and memory for your coding agents, in one Rust program. For Claude Code, Codex, Cursor and any MCP client.

memory tests: scratch folders get a per-process counter, so parallel tests on macOS never share a name

VikramLex8de6a9d185d2
diff --git a/crates/graphicle-memory/tests/graph_bridge.rs b/crates/graphicle-memory/tests/graph_bridge.rs
index a886cdb..2a0c2e4 100644
--- a/crates/graphicle-memory/tests/graph_bridge.rs
+++ b/crates/graphicle-memory/tests/graph_bridge.rs
@@ -22,11 +22,16 @@ struct Scratch(PathBuf);
impl Scratch {
fn new() -> Self {
+ // macOS clocks tick in microseconds, so tests on parallel threads can
+ // read the same time: a per-process counter keeps the names apart.
+ static NEXT: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0);
+ let seq = NEXT.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
let nonce = std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.unwrap()
.as_nanos();
- let path = std::env::temp_dir().join(format!("graphicle-{}-{nonce}", std::process::id()));
+ let path =
+ std::env::temp_dir().join(format!("graphicle-{}-{nonce}-{seq}", std::process::id()));
std::fs::create_dir(&path).unwrap();
Self(path)
}