From 42e63b1ee79c1c30d5ed2a35b14695f1746818da Mon Sep 17 00:00:00 2001 From: atlas Date: Wed, 28 Oct 2026 13:53:50 +0100 Subject: [PATCH] give the authelia-bridge store tests a unique temp dir each --- swarm-authelia-bridge/src/store.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/swarm-authelia-bridge/src/store.rs b/swarm-authelia-bridge/src/store.rs index 474eb99f..046b3546 100644 --- a/swarm-authelia-bridge/src/store.rs +++ b/swarm-authelia-bridge/src/store.rs @@ -793,14 +793,13 @@ some_future_top_level_key: 7 /// one test's lifetime, not durable state (see `state-not-tmp`: this /// is exactly the legitimate use, not a place we persist anything). fn tempdir() -> std::path::PathBuf { + static NEXT: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0); let dir = std::env::temp_dir().join(format!( "swarm-authelia-bridge-test-{}-{}", std::process::id(), - std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .unwrap() - .as_nanos() + NEXT.fetch_add(1, std::sync::atomic::Ordering::Relaxed) )); + fs::remove_dir_all(&dir).ok(); fs::create_dir_all(&dir).unwrap(); dir }