Skip to content

Commit 11c92ff

Browse files
committed
chore(tests): set a short timeout on the integration clients pool
1 parent d19d95a commit 11c92ff

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/client/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,11 @@ impl Builder {
571571
///
572572
/// Default is 90 seconds.
573573
#[inline]
574-
pub fn keep_alive_timeout(&mut self, val: Option<Duration>) -> &mut Self {
575-
self.keep_alive_timeout = val;
574+
pub fn keep_alive_timeout<D>(&mut self, val: D) -> &mut Self
575+
where
576+
D: Into<Option<Duration>>,
577+
{
578+
self.keep_alive_timeout = val.into();
576579
self
577580
}
578581

tests/support/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,14 @@ pub fn __run_test(cfg: __TestConfig) {
192192
use hyper::{Body, Client, Request, Response};
193193
use hyper::client::HttpConnector;
194194
use std::sync::{Arc, Mutex};
195+
use std::time::Duration;
195196
let _ = pretty_env_logger::try_init();
196197
let rt = Runtime::new().expect("new rt");
197198
let handle = rt.reactor().clone();
198199

199200
let connector = HttpConnector::new_with_handle(1, handle.clone());
200201
let client = Client::builder()
202+
.keep_alive_timeout(Duration::from_secs(10))
201203
.http2_only(cfg.client_version == 2)
202204
.executor(rt.executor())
203205
.build::<_, Body>(connector);

0 commit comments

Comments
 (0)