1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-24 00:50:36 +00:00

flaky test

This commit is contained in:
Nikolay Kim 2018-04-06 19:45:14 -07:00
parent 542315ce7f
commit a4b837a1c1

View file

@ -78,7 +78,6 @@ fn test_start() {
let (addr, srv_addr) = rx.recv().unwrap(); let (addr, srv_addr) = rx.recv().unwrap();
let mut sys = System::new("test-server"); let mut sys = System::new("test-server");
{ {
let req = client::ClientRequest::get(format!("http://{}/", addr).as_str()).finish().unwrap(); let req = client::ClientRequest::get(format!("http://{}/", addr).as_str()).finish().unwrap();
let response = sys.run_until_complete(req.send()).unwrap(); let response = sys.run_until_complete(req.send()).unwrap();
@ -87,11 +86,12 @@ fn test_start() {
// pause // pause
let _ = srv_addr.send(server::PauseServer).wait(); let _ = srv_addr.send(server::PauseServer).wait();
thread::sleep(time::Duration::from_millis(100)); thread::sleep(time::Duration::from_millis(200));
assert!(net::TcpStream::connect(addr).is_err()); assert!(net::TcpStream::connect(addr).is_err());
// resume // resume
let _ = srv_addr.send(server::ResumeServer).wait(); let _ = srv_addr.send(server::ResumeServer).wait();
thread::sleep(time::Duration::from_millis(200));
{ {
let req = client::ClientRequest::get(format!("http://{}/", addr).as_str()).finish().unwrap(); let req = client::ClientRequest::get(format!("http://{}/", addr).as_str()).finish().unwrap();