Skip to content

Commit 2ebf41f

Browse files
authored
Merge pull request #357 from AreevAI/fix/windows-unreachable-provider-test
Windows: accept the deadline form of an unreachable decision provider
2 parents bd8e43b + 591afde commit 2ebf41f

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎crates/areev-llm/tests/decide.rs‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,24 @@ fn an_unreachable_provider_is_a_retryable_e002() {
364364
let port = TcpListener::bind("127.0.0.1:0").unwrap().local_addr().unwrap().port();
365365
let b = SystemOneHttp::new("systemone", format!("http://127.0.0.1:{port}"), "m", None, vec![]);
366366
let e = b.decide(&req()).unwrap_err();
367+
// Unix refuses a closed loopback port at once, so the backend reports the
368+
// transport error the chain retries past — the classification this test
369+
// pins. Windows has been observed (GitHub's runner, intermittently) to
370+
// stall the connect instead of refusing it; the request then meets its
371+
// deadline, and the same physical condition — no listener — arrives as
372+
// "no answer" rather than "no connection". Both are the backend declining
373+
// to hang, so on Windows either shape is accepted; the immediate-refusal
374+
// classification is asserted only where the OS guarantees the refusal.
375+
#[cfg(not(windows))]
367376
assert!(matches!(e, DecideError::Provider { status: None, retryable: true, .. }), "{e:?}");
377+
#[cfg(windows)]
378+
assert!(
379+
matches!(
380+
e,
381+
DecideError::Provider { status: None, retryable: true, .. } | DecideError::Deadline(_)
382+
),
383+
"{e:?}"
384+
);
368385
}
369386

370387
// ---- chain ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)