give the authelia-bridge store tests a unique temp dir each
This commit is contained in:
parent
cbe41bea54
commit
42e63b1ee7
1 changed files with 3 additions and 4 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue