Watch
0
0
Fork
You've already forked hyperhive
0

give the authelia-bridge store tests a unique temp dir each

This commit is contained in:
atlas 2026-10-28 13:53:50 +01:00 • committed by mara
commit 42e63b1ee7

View file

@ -793,14 +793,13 @@ some_future_top_level_key: 7
/// one test's lifetime, not durable state (see `state-not-tmp`: this /// one test's lifetime, not durable state (see `state-not-tmp`: this
/// is exactly the legitimate use, not a place we persist anything). /// is exactly the legitimate use, not a place we persist anything).
fn tempdir() -> std::path::PathBuf { 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!( let dir = std::env::temp_dir().join(format!(
"swarm-authelia-bridge-test-{}-{}", "swarm-authelia-bridge-test-{}-{}",
std::process::id(), std::process::id(),
std::time::SystemTime::now() NEXT.fetch_add(1, std::sync::atomic::Ordering::Relaxed)
.duration_since(std::time::UNIX_EPOCH)
.unwrap()
.as_nanos()
)); ));
fs::remove_dir_all(&dir).ok();
fs::create_dir_all(&dir).unwrap(); fs::create_dir_all(&dir).unwrap();
dir dir
} }