diff --git a/crates/buzz-relay/src/handlers/group_state_postgres_tests.rs b/crates/buzz-relay/src/handlers/group_state_postgres_tests.rs index 89c38355ea..7d847e1a8f 100644 --- a/crates/buzz-relay/src/handlers/group_state_postgres_tests.rs +++ b/crates/buzz-relay/src/handlers/group_state_postgres_tests.rs @@ -12,8 +12,14 @@ use crate::handlers::ingest::{ingest_event, HttpAuthMethod, IngestAuth}; use crate::state::AppState; use buzz_auth::Scope; +/// Test state on the shared test database. The pool keeps sqlx's default +/// acquire timeout: `test_state_with_database_url` waits only 100 ms so +/// closed-port tests fail fast, and a first connect to a busy CI database can +/// take longer than that (`PoolTimedOut`). pub(crate) async fn state() -> Arc { - crate::state::tests::test_state_with_database_url(&crate::test_support::database_url()).await + let pool = + sqlx::PgPool::connect_lazy(&crate::test_support::database_url()).expect("lazy pg pool"); + crate::state::tests::test_state_with_database_pool(pool).await } pub(crate) async fn community(state: &AppState, label: &str) -> TenantContext {