Skip to content

Commit 4bf4d29

Browse files
committed
test(pool): re-enable pool expired checkout test
1 parent 786d18c commit 4bf4d29

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/client/legacy/pool.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ mod tests {
834834
use std::time::Duration;
835835

836836
use super::{Connecting, Key, Pool, Poolable, Reservation, WeakOpt};
837-
use crate::rt::TokioExecutor;
837+
use crate::rt::{TokioExecutor, TokioTimer};
838838

839839
use crate::common::timer;
840840

@@ -974,17 +974,14 @@ mod tests {
974974
}
975975

976976
#[tokio::test]
977-
#[ignore] // TODO
978977
async fn test_pool_timer_removes_expired() {
979-
tokio::time::pause();
980-
981978
let pool = Pool::new(
982979
super::Config {
983980
idle_timeout: Some(Duration::from_millis(10)),
984981
max_idle_per_host: std::usize::MAX,
985982
},
986983
TokioExecutor::new(),
987-
Option::<timer::Timer>::None,
984+
Some(TokioTimer::new()),
988985
);
989986

990987
let key = host_key("foo");
@@ -999,7 +996,7 @@ mod tests {
999996
);
1000997

1001998
// Let the timer tick passed the expiration...
1002-
tokio::time::advance(Duration::from_millis(30)).await;
999+
tokio::time::sleep(Duration::from_millis(30)).await;
10031000
// Yield so the Interval can reap...
10041001
tokio::task::yield_now().await;
10051002

0 commit comments

Comments
 (0)