tests: do not report expected autobahn errors

Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
pull/9/head
Alexey Galakhov 5 years ago committed by Sebastian Dröge
parent 40757271f0
commit 016f21f5b4
  1. 9
      examples/autobahn-client.rs
  2. 9
      examples/autobahn-server.rs

@ -1,4 +1,4 @@
use async_tungstenite::{async_std::connect_async, tungstenite::Result}; use async_tungstenite::{async_std::connect_async, tungstenite::Error, tungstenite::Result};
use futures::{SinkExt, StreamExt}; use futures::{SinkExt, StreamExt};
use log::*; use log::*;
use url::Url; use url::Url;
@ -56,8 +56,11 @@ async fn run() {
let total = get_case_count().await.expect("Error getting case count"); let total = get_case_count().await.expect("Error getting case count");
for case in 1..=total { for case in 1..=total {
if let Err(err) = run_test(case).await { if let Err(e) = run_test(case).await {
error!("Testcase failed: {}", err); match e {
Error::ConnectionClosed | Error::Protocol(_) | Error::Utf8 => (),
err => error!("Testcase failed: {}", err),
}
} }
} }

@ -1,12 +1,15 @@
use async_std::net::{SocketAddr, TcpListener, TcpStream}; use async_std::net::{SocketAddr, TcpListener, TcpStream};
use async_tungstenite::accept_async; use async_tungstenite::{accept_async, tungstenite::Error};
use futures::{SinkExt, StreamExt}; use futures::{SinkExt, StreamExt};
use log::*; use log::*;
use tungstenite::Result; use tungstenite::Result;
async fn accept_connection(peer: SocketAddr, stream: TcpStream) { async fn accept_connection(peer: SocketAddr, stream: TcpStream) {
if let Err(err) = handle_connection(peer, stream).await { if let Err(e) = handle_connection(peer, stream).await {
error!("Error processing connection: {}", err); match e {
Error::ConnectionClosed | Error::Protocol(_) | Error::Utf8 => (),
err => error!("Error processing connection: {}", err),
}
} }
} }

Loading…
Cancel
Save