diff --git a/tests/push.rs b/tests/push.rs index b1ad0d08..187e5cbd 100644 --- a/tests/push.rs +++ b/tests/push.rs @@ -57,6 +57,8 @@ async fn push_queues_error_on_closed() { } /// A push beyond the configured rate is blocked. +/// Time is paused using [`tokio::time::pause`], so the test runs in a +/// virtual-time context. #[rstest] #[case::high(PushPriority::High)] #[case::low(PushPriority::Low)] @@ -107,6 +109,8 @@ async fn rate_limiter_allows_after_wait() { } /// The limiter counts pushes from all priority queues. +/// The token bucket is shared, so pushes from one priority reduce +/// the allowance for the other. #[tokio::test] async fn rate_limiter_shared_across_priorities() { time::pause(); @@ -142,6 +146,7 @@ async fn unlimited_queues_do_not_block() { } /// A burst up to capacity succeeds and further pushes are blocked. +/// The maximum burst size equals the configured `capacity` parameter. #[tokio::test] async fn rate_limiter_allows_burst_within_capacity_and_blocks_excess() { time::pause(); diff --git a/wireframe_testing/src/lib.rs b/wireframe_testing/src/lib.rs index 8657b8e2..34002b56 100644 --- a/wireframe_testing/src/lib.rs +++ b/wireframe_testing/src/lib.rs @@ -2,7 +2,9 @@ //! with in-memory streams during tests. //! //! These helpers spawn the application on a `tokio::io::duplex` stream and -//! return all bytes written by the app for easy assertions. +//! return all bytes written by the app for easy assertions. They work with any +//! message implementing [`bincode::Encode`] – the example uses a simple `u8` +//! value so no generics are required. //! //! ```rust //! use wireframe::app::WireframeApp; diff --git a/wireframe_testing/src/logging.rs b/wireframe_testing/src/logging.rs index 0f312e13..b7af3226 100644 --- a/wireframe_testing/src/logging.rs +++ b/wireframe_testing/src/logging.rs @@ -43,10 +43,10 @@ impl LoggerHandle { /// /// ```no_run /// use wireframe_testing::LoggerHandle; - /// # use log::info; + /// # use log::warn; /// /// let mut log = LoggerHandle::new(); - /// info!("init"); + /// warn!("warned"); /// assert!(log.pop().is_some()); /// assert!(log.pop().is_none()); /// ```