mirror of https://github.com/fafhrd91/actix-web
test(http): wrap timeout test with rt::time::timeout (#3915)
This commit is contained in:
parent
4f0912d1c7
commit
9f679990ed
|
|
@ -149,10 +149,16 @@ async fn h2_content_length() {
|
|||
|
||||
{
|
||||
let req = srv.request(Method::HEAD, srv.surl("/0")).send();
|
||||
req.await.expect_err("should timeout on recv 1xx frame");
|
||||
actix_rt::time::timeout(Duration::from_secs(15), req)
|
||||
.await
|
||||
.expect("request future stalled on recv 1xx frame")
|
||||
.expect_err("should timeout on recv 1xx frame");
|
||||
|
||||
let req = srv.request(Method::GET, srv.surl("/0")).send();
|
||||
req.await.expect_err("should timeout on recv 1xx frame");
|
||||
actix_rt::time::timeout(Duration::from_secs(15), req)
|
||||
.await
|
||||
.expect("request future stalled on recv 1xx frame")
|
||||
.expect_err("should timeout on recv 1xx frame");
|
||||
|
||||
let req = srv.request(Method::GET, srv.surl("/1")).send();
|
||||
let response = req.await.unwrap();
|
||||
|
|
|
|||
|
|
@ -219,13 +219,19 @@ async fn h2_content_length() {
|
|||
let req = srv
|
||||
.request(Method::HEAD, srv.surl(&format!("/{}", i)))
|
||||
.send();
|
||||
let _response = req.await.expect_err("should timeout on recv 1xx frame");
|
||||
actix_rt::time::timeout(Duration::from_secs(15), req)
|
||||
.await
|
||||
.expect("request future stalled on recv 1xx frame")
|
||||
.expect_err("should timeout on recv 1xx frame");
|
||||
// assert_eq!(response.headers().get(&header), None);
|
||||
|
||||
let req = srv
|
||||
.request(Method::GET, srv.surl(&format!("/{}", i)))
|
||||
.send();
|
||||
let _response = req.await.expect_err("should timeout on recv 1xx frame");
|
||||
actix_rt::time::timeout(Duration::from_secs(15), req)
|
||||
.await
|
||||
.expect("request future stalled on recv 1xx frame")
|
||||
.expect_err("should timeout on recv 1xx frame");
|
||||
// assert_eq!(response.headers().get(&header), None);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue