mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-03 21:07:39 +03:00
Handle flaky tests
This commit is contained in:
parent
f6fe9c3e10
commit
e4f24ee41f
2 changed files with 3 additions and 3 deletions
|
@ -459,7 +459,7 @@ async fn test_h2_client_drop() -> io::Result<()> {
|
||||||
.map_err(|_| ())
|
.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());
|
assert!(result.is_err());
|
||||||
let _ = timeout(Millis(1500), rx).await;
|
let _ = timeout(Millis(1500), rx).await;
|
||||||
assert_eq!(count.load(Ordering::Relaxed), 1);
|
assert_eq!(count.load(Ordering::Relaxed), 1);
|
||||||
|
|
|
@ -749,13 +749,13 @@ async fn test_h1_client_drop() -> io::Result<()> {
|
||||||
let _st = SetOnDrop(count, tx.lock().unwrap().take());
|
let _st = SetOnDrop(count, tx.lock().unwrap().take());
|
||||||
assert!(req.peer_addr().is_some());
|
assert!(req.peer_addr().is_some());
|
||||||
assert_eq!(req.version(), Version::HTTP_11);
|
assert_eq!(req.version(), Version::HTTP_11);
|
||||||
sleep(Millis(500)).await;
|
sleep(Millis(50000)).await;
|
||||||
Ok::<_, io::Error>(Response::Ok().finish())
|
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());
|
assert!(result.is_err());
|
||||||
let _ = rx.await;
|
let _ = rx.await;
|
||||||
assert_eq!(count.load(Ordering::Relaxed), 1);
|
assert_eq!(count.load(Ordering::Relaxed), 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue