diff --git a/backend/tests/common/mod.rs b/backend/tests/common/mod.rs index 40ebcb4..2cb4f1c 100644 --- a/backend/tests/common/mod.rs +++ b/backend/tests/common/mod.rs @@ -475,8 +475,9 @@ impl TestApp { impl Drop for TestApp { fn drop(&mut self) { - // Best-effort synchronous cleanup. The `cleanup()` async method is - // preferred, but this catches cases where it wasn't called. + // Fire-and-forget cleanup. Don't .join() — that deadlocks when + // running inside a tokio runtime (the spawned thread's block_on + // conflicts with the existing runtime's connection pool). let admin_pool = self.admin_pool.clone(); let db_name = self.db_name.clone(); let test_pool = self.pool.clone(); @@ -502,8 +503,7 @@ impl Drop for TestApp { .execute(format!("DROP DATABASE IF EXISTS \"{}\"", db_name).as_str()) .await; }); - }) - .join() - .ok(); + }); + // Don't join — let the cleanup thread run independently } }