play-faults fix: bound the stalled-body test so a client that ignores its timeout fails it
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3ee4ab8e88
commit
97e39f48fd
1 changed files with 9 additions and 3 deletions
|
|
@ -1647,9 +1647,15 @@ mod tests {
|
|||
#[tokio::test]
|
||||
async fn a_body_that_stalls_is_a_timeout_not_retried() {
|
||||
let addr = truncated_body_endpoint(true).await;
|
||||
let fault = infer_once(&port_with_timeout(addr, std::time::Duration::from_millis(300)))
|
||||
.await
|
||||
.expect_err("a stalled body produced an output");
|
||||
// Bounded, so a client that ignores the timeout it was given fails
|
||||
// here instead of waiting out a longer one.
|
||||
let fault = tokio::time::timeout(
|
||||
std::time::Duration::from_secs(10),
|
||||
infer_once(&port_with_timeout(addr, std::time::Duration::from_millis(300))),
|
||||
)
|
||||
.await
|
||||
.expect("the client honours the timeout it was given")
|
||||
.expect_err("a stalled body produced an output");
|
||||
assert_eq!(fault.class(), InferenceFaultClass::Timeout, "{fault:?}");
|
||||
assert_eq!(fault.disposition(), InferenceFaultDisposition::RecoveryRequired, "{fault:?}");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue