From 5f1f47a96653d5e342d625af3b668db20ada7739 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Thu, 2 Apr 2026 07:13:51 -0700 Subject: [PATCH] Increase polling budgets for server tests that fail under concurrent load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unit tests used 100×10ms=1s polling, insufficient when 82 tests run concurrently. Integration tests already used 500×10ms=5s. SSE test frame timeout was 500ms, too short for stage events to arrive under CPU contention. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/crates/fabro-server/src/server.rs | 11 +++++++---- lib/crates/fabro-server/tests/it/api.rs | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/crates/fabro-server/src/server.rs b/lib/crates/fabro-server/src/server.rs index cb741e7f3..9285a0942 100644 --- a/lib/crates/fabro-server/src/server.rs +++ b/lib/crates/fabro-server/src/server.rs @@ -1633,6 +1633,9 @@ mod tests { start -> exit }"#; + const POLL_INTERVAL: std::time::Duration = std::time::Duration::from_millis(10); + const POLL_ATTEMPTS: usize = 500; + fn dry_run_settings() -> FabroSettings { FabroSettings { dry_run: Some(true), @@ -2187,8 +2190,8 @@ mod tests { // Poll until run completes let mut status = String::new(); - for _ in 0..100 { - tokio::time::sleep(std::time::Duration::from_millis(10)).await; + for _ in 0..POLL_ATTEMPTS { + tokio::time::sleep(POLL_INTERVAL).await; let req = Request::builder() .method("GET") .uri(api(&format!("/runs/{run_id}"))) @@ -2365,8 +2368,8 @@ mod tests { // Poll until run completes let mut status = String::new(); - for _ in 0..100 { - tokio::time::sleep(std::time::Duration::from_millis(10)).await; + for _ in 0..POLL_ATTEMPTS { + tokio::time::sleep(POLL_INTERVAL).await; let req = Request::builder() .method("GET") .uri(api(&format!("/runs/{run_id}"))) diff --git a/lib/crates/fabro-server/tests/it/api.rs b/lib/crates/fabro-server/tests/it/api.rs index 5f167aee1..386b5171f 100644 --- a/lib/crates/fabro-server/tests/it/api.rs +++ b/lib/crates/fabro-server/tests/it/api.rs @@ -786,7 +786,7 @@ mod sse_events { let mut body = response.into_body(); let mut sse_data = String::new(); while let Ok(Some(Ok(frame))) = - tokio::time::timeout(Duration::from_millis(500), body.frame()).await + tokio::time::timeout(Duration::from_secs(2), body.frame()).await { if let Some(data) = frame.data_ref() { sse_data.push_str(&String::from_utf8_lossy(data));