mirror of https://github.com/fafhrd91/actix-net
add more delay to test
This commit is contained in:
parent
9da557f61d
commit
5c64ad9750
|
@ -479,6 +479,8 @@ async fn test_worker_restart() {
|
|||
|
||||
stream.flush().unwrap();
|
||||
|
||||
stream.shutdown(net::Shutdown::Both).unwrap();
|
||||
|
||||
// force worker 2 to restart service once.
|
||||
if counter == 2 {
|
||||
panic!("panic on purpose")
|
||||
|
@ -533,6 +535,8 @@ async fn test_worker_restart() {
|
|||
assert_eq!("1", id);
|
||||
stream.shutdown().await.unwrap();
|
||||
|
||||
sleep(Duration::from_secs(3)).await;
|
||||
|
||||
// worker 2 restarting and work goes to worker 1.
|
||||
let mut stream = TcpStream::connect(addr).await.unwrap();
|
||||
let n = stream.read(&mut buf).await.unwrap();
|
||||
|
|
Loading…
Reference in New Issue