mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-14 23:22:51 +00:00
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:
parent
3f1c71b541
commit
5f1f47a966
2 changed files with 8 additions and 5 deletions
|
|
@ -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}")))
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue