Skip to content

Commit 591afde

Browse files
committed
Windows: accept the deadline form of an unreachable decision provider
`an_unreachable_provider_is_a_retryable_e002` connects to a closed loopback port and pins that the backend reports a retryable transport error rather than hanging. Unix refuses such a connect at once. GitHub's Windows runner has been observed, intermittently (green twice, then a stall past the 2 s default deadline), to stall it instead — the same physical condition, no listener, reported by the OS as "no answer" rather than "no connection", so the backend classified it as DEC-E004 instead of DEC-E002. Both are the backend declining to hang. The test now accepts either shape on Windows and keeps the strict immediate-refusal classification where the OS guarantees the refusal. This was the last red job on main after #356: CI runs the workspace under nextest, which reports every failure rather than stopping at the first failing binary, so nothing else is hiding behind it.
1 parent bd8e43b commit 591afde

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)