From 11c92ff467679262a3955ce7240b5c721578de1e Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Thu, 26 Apr 2018 12:37:31 -0700 Subject: [PATCH] chore(tests): set a short timeout on the integration clients pool --- src/client/mod.rs | 7 +++++-- tests/support/mod.rs | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/client/mod.rs b/src/client/mod.rs index c1d56a41..4829c7a3 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -571,8 +571,11 @@ impl Builder { /// /// Default is 90 seconds. #[inline] - pub fn keep_alive_timeout(&mut self, val: Option) -> &mut Self { - self.keep_alive_timeout = val; + pub fn keep_alive_timeout(&mut self, val: D) -> &mut Self + where + D: Into>, + { + self.keep_alive_timeout = val.into(); self } diff --git a/tests/support/mod.rs b/tests/support/mod.rs index 7444069e..17650fcb 100644 --- a/tests/support/mod.rs +++ b/tests/support/mod.rs @@ -192,12 +192,14 @@ pub fn __run_test(cfg: __TestConfig) { use hyper::{Body, Client, Request, Response}; use hyper::client::HttpConnector; use std::sync::{Arc, Mutex}; + use std::time::Duration; let _ = pretty_env_logger::try_init(); let rt = Runtime::new().expect("new rt"); let handle = rt.reactor().clone(); let connector = HttpConnector::new_with_handle(1, handle.clone()); let client = Client::builder() + .keep_alive_timeout(Duration::from_secs(10)) .http2_only(cfg.client_version == 2) .executor(rt.executor()) .build::<_, Body>(connector);