5 more tests to go

This commit is contained in:
filipriec
2025-06-21 21:01:49 +02:00
parent 298f56a53c
commit 06d98aab5c
5 changed files with 22 additions and 16 deletions

View File

@@ -24,13 +24,17 @@ async fn get_root_connection() -> PgConnection {
/// This is the key to test isolation.
pub async fn setup_isolated_db() -> PgPool {
let mut root_conn = get_root_connection().await;
// Make schema names more unique - include timestamp + random
let schema_name = format!(
"test_{}",
"test_{}_{}",
std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.unwrap()
.as_nanos(),
rand::thread_rng()
// --- CHANGE 2: Pass a reference to Alphanumeric directly ---
.sample_iter(&Alphanumeric)
.take(12)
.take(8)
.map(char::from)
.collect::<String>()
.to_lowercase()