From e4f24ee41f2fec056c782c63ba2e3bea1f041a1b Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Fri, 28 Mar 2025 11:39:24 +0100 Subject: [PATCH] Handle flaky tests --- ntex/tests/http_openssl.rs | 2 +- ntex/tests/http_server.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ntex/tests/http_openssl.rs b/ntex/tests/http_openssl.rs index 2d2c98f9..921310a8 100644 --- a/ntex/tests/http_openssl.rs +++ b/ntex/tests/http_openssl.rs @@ -459,7 +459,7 @@ async fn test_h2_client_drop() -> io::Result<()> { .map_err(|_| ()) }); - let result = timeout(Millis(150), srv.srequest(Method::GET, "/").send()).await; + let result = timeout(Millis(1500), srv.srequest(Method::GET, "/").send()).await; assert!(result.is_err()); let _ = timeout(Millis(1500), rx).await; assert_eq!(count.load(Ordering::Relaxed), 1); diff --git a/ntex/tests/http_server.rs b/ntex/tests/http_server.rs index 64ab4ede..0227573b 100644 --- a/ntex/tests/http_server.rs +++ b/ntex/tests/http_server.rs @@ -749,13 +749,13 @@ async fn test_h1_client_drop() -> io::Result<()> { let _st = SetOnDrop(count, tx.lock().unwrap().take()); assert!(req.peer_addr().is_some()); assert_eq!(req.version(), Version::HTTP_11); - sleep(Millis(500)).await; + sleep(Millis(50000)).await; Ok::<_, io::Error>(Response::Ok().finish()) } }) }); - let result = timeout(Millis(100), srv.request(Method::GET, "/").send()).await; + let result = timeout(Millis(1500), srv.request(Method::GET, "/").send()).await; assert!(result.is_err()); let _ = rx.await; assert_eq!(count.load(Ordering::Relaxed), 1);