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