chore(tests): set a short timeout on the integration clients pool
This commit is contained in:
@@ -571,8 +571,11 @@ impl Builder {
|
|||||||
///
|
///
|
||||||
/// Default is 90 seconds.
|
/// Default is 90 seconds.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn keep_alive_timeout(&mut self, val: Option<Duration>) -> &mut Self {
|
pub fn keep_alive_timeout<D>(&mut self, val: D) -> &mut Self
|
||||||
self.keep_alive_timeout = val;
|
where
|
||||||
|
D: Into<Option<Duration>>,
|
||||||
|
{
|
||||||
|
self.keep_alive_timeout = val.into();
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -192,12 +192,14 @@ pub fn __run_test(cfg: __TestConfig) {
|
|||||||
use hyper::{Body, Client, Request, Response};
|
use hyper::{Body, Client, Request, Response};
|
||||||
use hyper::client::HttpConnector;
|
use hyper::client::HttpConnector;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
use std::time::Duration;
|
||||||
let _ = pretty_env_logger::try_init();
|
let _ = pretty_env_logger::try_init();
|
||||||
let rt = Runtime::new().expect("new rt");
|
let rt = Runtime::new().expect("new rt");
|
||||||
let handle = rt.reactor().clone();
|
let handle = rt.reactor().clone();
|
||||||
|
|
||||||
let connector = HttpConnector::new_with_handle(1, handle.clone());
|
let connector = HttpConnector::new_with_handle(1, handle.clone());
|
||||||
let client = Client::builder()
|
let client = Client::builder()
|
||||||
|
.keep_alive_timeout(Duration::from_secs(10))
|
||||||
.http2_only(cfg.client_version == 2)
|
.http2_only(cfg.client_version == 2)
|
||||||
.executor(rt.executor())
|
.executor(rt.executor())
|
||||||
.build::<_, Body>(connector);
|
.build::<_, Body>(connector);
|
||||||
|
|||||||
Reference in New Issue
Block a user