From 7c78797d9b9acc1653d6cc8338ef4ef71a756422 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Mon, 1 Oct 2018 21:30:00 -0700 Subject: [PATCH] proper stop for test_ws_stopped test --- tests/test_ws.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/test_ws.rs b/tests/test_ws.rs index 67c4c591..f67314e8 100644 --- a/tests/test_ws.rs +++ b/tests/test_ws.rs @@ -361,7 +361,7 @@ struct WsStopped(Arc); impl Actor for WsStopped { type Context = ws::WebsocketContext; - fn stopped(&mut self, ctx: &mut Self::Context) { + fn stopped(&mut self, _: &mut Self::Context) { self.0.fetch_add(1, Ordering::Relaxed); } } @@ -387,12 +387,10 @@ fn test_ws_stopped() { app.handler(move |req| ws::start(req, WsStopped(num4.clone()))) }); let (reader, mut writer) = srv.ws().unwrap(); - writer.text("text"); - let (item, reader) = srv.execute(reader.into_future()).unwrap(); + let (item, _) = srv.execute(reader.into_future()).unwrap(); assert_eq!(item, Some(ws::Message::Text("text".to_owned()))); - }); + }).join(); - thread::sleep(time::Duration::from_secs(3)); assert_eq!(num.load(Ordering::Relaxed), 1); }