From 77dd580b0dc6e0696081c37449928d15afcbac08 Mon Sep 17 00:00:00 2001 From: Logan Johnson Date: Fri, 23 Oct 2026 16:44:00 -0400 Subject: [PATCH] test(relay): give group-state Postgres tests a normal acquire timeout group_state_postgres_tests::state() built its pool through test_state_with_database_url, whose 100 ms acquire timeout exists so closed-port tests fail fast. Against the real test database a first connect on a busy CI runner can exceed that, and the tests fail with PoolTimedOut while creating their community. Build the pool with sqlx's default timeout and hand it to test_state_with_database_pool. Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 Signed-off-by: Logan Johnson --- .../buzz-relay/src/handlers/group_state_postgres_tests.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 {