Skip to content

Commit

Permalink
chore(tests): set a short timeout on the integration clients pool
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Apr 26, 2018
1 parent d19d95a commit 11c92ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,11 @@ impl Builder {
///
/// Default is 90 seconds.
#[inline]
pub fn keep_alive_timeout(&mut self, val: Option<Duration>) -> &mut Self {
self.keep_alive_timeout = val;
pub fn keep_alive_timeout<D>(&mut self, val: D) -> &mut Self
where
D: Into<Option<Duration>>,
{
self.keep_alive_timeout = val.into();
self
}

Expand Down
2 changes: 2 additions & 0 deletions tests/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 11c92ff

Please sign in to comment.