Skip to content

Commit

Permalink
test(pool): re-enable pool expired checkout test
Browse files Browse the repository at this point in the history
  • Loading branch information
dswij committed Dec 28, 2023
1 parent fd696a6 commit b98bfc6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/client/legacy/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ mod tests {
use std::time::Duration;

use super::{Connecting, Key, Pool, Poolable, Reservation, WeakOpt};
use crate::rt::TokioExecutor;
use crate::rt::{TokioExecutor, TokioTimer};

use crate::common::timer;

Expand Down Expand Up @@ -973,17 +973,14 @@ mod tests {
}

#[tokio::test]
#[ignore] // TODO
async fn test_pool_timer_removes_expired() {
tokio::time::pause();

let pool = Pool::new(
super::Config {
idle_timeout: Some(Duration::from_millis(10)),
max_idle_per_host: std::usize::MAX,
},
TokioExecutor::new(),
Option::<timer::Timer>::None,
Some(TokioTimer::new()),
);

let key = host_key("foo");
Expand All @@ -998,7 +995,7 @@ mod tests {
);

// Let the timer tick passed the expiration...
tokio::time::advance(Duration::from_millis(30)).await;
tokio::time::sleep(Duration::from_millis(30)).await;
// Yield so the Interval can reap...
tokio::task::yield_now().await;

Expand Down

0 comments on commit b98bfc6

Please sign in to comment.