diff --git a/openfut-utas-host/tests/economy_integration.rs b/openfut-utas-host/tests/economy_integration.rs index 61fc945..b4ef59c 100644 --- a/openfut-utas-host/tests/economy_integration.rs +++ b/openfut-utas-host/tests/economy_integration.rs @@ -21,7 +21,12 @@ use serde_json::{json, Value}; /// Boot a Core instance against `db_url`, serving on an ephemeral port. Returns /// the serve task handle and its base URL. async fn start_core(db_url: &str) -> (tokio::task::JoinHandle<()>, String) { - let pool = openfut_core::db::init_pool(db_url, 5) + // One pooled connection: the harness drives Core sequentially (blocking + // client), so a single connection serializes access deterministically and + // avoids a WAL-mode-establishment race across connections warming up on a + // brand-new DB file. (Steady-state multi-connection concurrency is a + // separate, deferred requirement.) + let pool = openfut_core::db::init_pool(db_url, 1) .await .expect("core pool"); openfut_core::db::run_migrations(&pool) @@ -43,7 +48,10 @@ async fn start_core(db_url: &str) -> (tokio::task::JoinHandle<()>, String) { fn wait_ready(base: &str) { let http = reqwest::blocking::Client::new(); - for _ in 0..100 { + // Generous ceiling (~30s): returns on first success, so it only ever waits + // this long if Core genuinely never comes up. Under heavy parallel test-binary + // load Core's content load (CardDb::load) can take several seconds to be ready. + for _ in 0..1500 { if let Ok(r) = http.get(format!("{base}/health")).send() { if r.status().is_success() { return;