From 7c3e5115808e5211067d48d05c062818269a9fea Mon Sep 17 00:00:00 2001 From: Falk Woldmann Lu <52786457+FalkWoldmann@users.noreply.github.com> Date: Mon, 12 Oct 2026 07:26:47 +0200 Subject: [PATCH] Fix HTTP/3 hang with a rate limit and --latency-correction work_with_qps_latency_correction never awaited its work queue, so no request was sent. --- src/client_h3.rs | 3 ++- tests/tests.rs | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/client_h3.rs b/src/client_h3.rs index 22dab23f..46f4efc6 100644 --- a/src/client_h3.rs +++ b/src/client_h3.rs @@ -722,7 +722,7 @@ pub async fn work_with_qps_latency_correction( ) { let (tx, rx) = kanal::unbounded(); - let _work_queue = async move { + let work_queue = async move { match query_limit { QueryLimit::Qps(qps) => { let start = std::time::Instant::now(); @@ -772,6 +772,7 @@ pub async fn work_with_qps_latency_correction( None, ) .await; + work_queue.await.unwrap(); for f in futures { let _ = f.await; } diff --git a/tests/tests.rs b/tests/tests.rs index fec155c0..901fee72 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -885,6 +885,26 @@ async fn test_ipv6() { rx.try_recv().unwrap().unwrap(); } +#[apply(test_all_http_versions)] +#[tokio::test] +async fn test_latency_correction(http_version_param: &str) { + tokio::time::timeout( + std::time::Duration::from_secs(10), + get_req( + "/", + &[ + "-q", + "10", + "--latency-correction", + "--http-version", + http_version_param, + ], + ), + ) + .await + .expect("oha did not finish"); +} + #[tokio::test] async fn test_query_limit() { // burst 10 requests with delay of 2s and rate of 4