Give each test engine a unique temp path so parallel scram tests don't race
All checks were successful
CI / check (push) Successful in 5m17s

This commit is contained in:
Jean Chevronnet 2026-07-20 22:39:02 +00:00
parent 1c6b8c799f
commit 7cb1c61afa
No known key found for this signature in database

View file

@ -12,7 +12,14 @@
} }
fn engine_with(name: &str, account: &str, password: &str) -> Engine { fn engine_with(name: &str, account: &str, password: &str) -> Engine {
let path = std::env::temp_dir().join(format!("echo-sasl-{name}.jsonl")); // A globally-unique path per call: tests run in parallel and some share a
// `name` (e.g. every scram_exchange caller), so a fixed path would race.
let path = {
use std::sync::atomic::{AtomicU64, Ordering};
static SEQ: AtomicU64 = AtomicU64::new(0);
let n = SEQ.fetch_add(1, Ordering::Relaxed);
std::env::temp_dir().join(format!("echo-sasl-{name}-{}-{n}.jsonl", std::process::id()))
};
let _ = std::fs::remove_file(&path); let _ = std::fs::remove_file(&path);
let mut db = Db::open(&path, "test"); let mut db = Db::open(&path, "test");
db.scram_iterations = 4096; // keep the debug-build verifier cheap in tests db.scram_iterations = 4096; // keep the debug-build verifier cheap in tests