Increase polling budgets for server tests that fail under concurrent load

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) <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-04-02 07:13:51 -07:00
parent 3f1c71b541
commit 5f1f47a966
No known key found for this signature in database
2 changed files with 8 additions and 5 deletions

View file

@ -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}")))

View file

@ -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));