Unverified Commit 5dbfa50a authored by Alexandru Vasile's avatar Alexandru Vasile
Browse files

tests: Call `on_disconnect` with closed server


Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>
parent ba762260
Pipeline #206346 passed with stages
in 4 minutes and 43 seconds
......@@ -510,6 +510,24 @@ async fn ws_server_notify_client_on_disconnect() {
let _ = multiple_rx.await.unwrap();
}
#[tokio::test]
async fn ws_server_notify_client_on_disconnect_with_closed_server() {
init_logger();
let (server_addr, server_handle) = websocket_server_with_subscription().await;
let server_url = format!("ws://{}", server_addr);
let client = WsClientBuilder::default().build(&server_url).await.unwrap();
// Validate server is up.
client.request::<String>("say_hello", None).await.unwrap();
// Stop the server.
server_handle.stop().unwrap().await;
// Ensure `on_disconnect` returns when the call is made after the server is closed.
client.on_disconnect().await;
}
#[tokio::test]
async fn ws_server_cancels_subscriptions_on_reset_conn() {
init_logger();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment