From a5f8534573747cbe1586c6f37a16e539f9651197 Mon Sep 17 00:00:00 2001 From: Yury Yarashevich Date: Tue, 1 Aug 2023 16:39:16 +0200 Subject: [PATCH] Check WS stream completed after close. --- actix-web-actors/tests/test_ws.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/actix-web-actors/tests/test_ws.rs b/actix-web-actors/tests/test_ws.rs index cf12a0052..ffe17edcf 100644 --- a/actix-web-actors/tests/test_ws.rs +++ b/actix-web-actors/tests/test_ws.rs @@ -52,6 +52,10 @@ async fn common_test_code(mut srv: actix_test::TestServer, frame_size: usize) { .unwrap(); let item = framed.next().await.unwrap().unwrap(); assert_eq!(item, ws::Frame::Close(Some(ws::CloseCode::Normal.into()))); + + let nothing = actix_rt::time::timeout(std::time::Duration::from_secs(1), framed.next()).await; + assert_eq!(true, nothing.is_ok()); + assert_eq!(true, nothing.unwrap().is_none()); } #[actix_rt::test]