diff --git a/zebra-network/src/meta_addr/tests/prop.rs b/zebra-network/src/meta_addr/tests/prop.rs index 380c63ef..918a8696 100644 --- a/zebra-network/src/meta_addr/tests/prop.rs +++ b/zebra-network/src/meta_addr/tests/prop.rs @@ -11,7 +11,7 @@ use std::{ }; use proptest::{collection::vec, prelude::*}; -use tokio::{runtime::Runtime, time::Instant}; +use tokio::{runtime, time::Instant}; use tower::service_fn; use tracing::Span; @@ -332,7 +332,10 @@ proptest! { "there are enough changes for good test coverage", ); - let runtime = Runtime::new().expect("Failed to create Tokio runtime"); + let runtime = runtime::Builder::new_current_thread() + .enable_all() + .build() + .expect("Failed to create Tokio runtime"); let _guard = runtime.enter(); // Only put valid addresses in the address book. @@ -424,7 +427,10 @@ proptest! { "there are enough changes for good test coverage", ); - let runtime = Runtime::new().expect("Failed to create Tokio runtime"); + let runtime = runtime::Builder::new_current_thread() + .enable_all() + .build() + .expect("Failed to create Tokio runtime"); let _guard = runtime.enter(); let attempt_counts = runtime.block_on(async move { diff --git a/zebra-network/src/peer_set/candidate_set/tests/vectors.rs b/zebra-network/src/peer_set/candidate_set/tests/vectors.rs index 2c29a8f4..1daee008 100644 --- a/zebra-network/src/peer_set/candidate_set/tests/vectors.rs +++ b/zebra-network/src/peer_set/candidate_set/tests/vectors.rs @@ -8,7 +8,7 @@ use std::{ use chrono::{DateTime, Duration, Utc}; use tokio::{ - runtime::Runtime, + runtime, time::{self, Instant}, }; use tracing::Span; @@ -138,7 +138,10 @@ fn candidate_set_updates_are_rate_limited() { zebra_test::init(); - let runtime = Runtime::new().expect("Failed to create Tokio runtime"); + let runtime = runtime::Builder::new_current_thread() + .enable_all() + .build() + .expect("Failed to create Tokio runtime"); let _guard = runtime.enter(); let address_book = AddressBook::new(SocketAddr::from_str("0.0.0.0:0").unwrap(), Span::none()); @@ -179,7 +182,10 @@ fn candidate_set_updates_are_rate_limited() { /// rate limited. #[test] fn candidate_set_update_after_update_initial_is_rate_limited() { - let runtime = Runtime::new().expect("Failed to create Tokio runtime"); + let runtime = runtime::Builder::new_current_thread() + .enable_all() + .build() + .expect("Failed to create Tokio runtime"); let _guard = runtime.enter(); let address_book = AddressBook::new(SocketAddr::from_str("0.0.0.0:0").unwrap(), Span::none());