diff --git a/Cargo.toml b/Cargo.toml index 26eb88bb..2a66cd45 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ atomic-waker = "1.0.0" futures-core = { version = "0.3", default-features = false } futures-sink = { version = "0.3", default-features = false } tokio-util = { version = "0.7.1", features = ["codec", "io"] } -tokio = { version = "1", features = ["io-util"] } +tokio = { version = "1", features = ["io-util", "time"] } bytes = "1" http = "1.1" tracing = { version = "0.1.35", default-features = false, features = ["std"] } diff --git a/src/proto/streams/recv.rs b/src/proto/streams/recv.rs index c56b368f..df56c68b 100644 --- a/src/proto/streams/recv.rs +++ b/src/proto/streams/recv.rs @@ -4,11 +4,11 @@ use crate::frame::{PushPromiseHeaderError, Reason, DEFAULT_INITIAL_WINDOW_SIZE}; use crate::proto; use http::{HeaderMap, Request, Response}; +use tokio::time::Instant; use std::cmp::Ordering; use std::io; use std::task::{Context, Poll, Waker}; -use std::time::Instant; #[derive(Debug)] pub(super) struct Recv { diff --git a/src/proto/streams/stream.rs b/src/proto/streams/stream.rs index 3b0ddec7..bc21b851 100644 --- a/src/proto/streams/stream.rs +++ b/src/proto/streams/stream.rs @@ -4,7 +4,8 @@ use super::*; use std::fmt; use std::task::{Context, Waker}; -use std::time::Instant; + +use tokio::time::Instant; /// Tracks Stream related state /// diff --git a/tests/h2-tests/Cargo.toml b/tests/h2-tests/Cargo.toml index 6afdf905..e8f0eccc 100644 --- a/tests/h2-tests/Cargo.toml +++ b/tests/h2-tests/Cargo.toml @@ -11,4 +11,4 @@ edition = "2018" h2-support = { path = "../h2-support" } tracing = "0.1.13" futures = { version = "0.3", default-features = false, features = ["alloc"] } -tokio = { version = "1", features = ["macros", "net", "rt", "io-util", "rt-multi-thread"] } +tokio = { version = "1", features = ["macros", "net", "rt", "io-util", "rt-multi-thread", "test-util"] } diff --git a/tests/h2-tests/tests/flow_control.rs b/tests/h2-tests/tests/flow_control.rs index 11d1207e..668c8d15 100644 --- a/tests/h2-tests/tests/flow_control.rs +++ b/tests/h2-tests/tests/flow_control.rs @@ -683,7 +683,7 @@ async fn padded_data_stream_error_releases_connection_capacity() { } // Regression test for TODO -#[tokio::test] +#[tokio::test(start_paused = true)] async fn padded_data_on_forgotten_stream_releases_connection_capacity() { h2_support::trace_init!(); let (io, mut srv) = mock::new(); diff --git a/tests/h2-tests/tests/stream_states.rs b/tests/h2-tests/tests/stream_states.rs index 531f39d0..fe50c282 100644 --- a/tests/h2-tests/tests/stream_states.rs +++ b/tests/h2-tests/tests/stream_states.rs @@ -982,7 +982,7 @@ async fn send_rst_stream_allows_recv_trailers() { join(srv, client).await; } -#[tokio::test] +#[tokio::test(start_paused = true)] async fn rst_stream_expires() { h2_support::trace_init!(); let (io, mut srv) = mock::new();