diff --git a/awc/tests/test_client.rs b/awc/tests/test_client.rs index 88987e63..8ca94ec9 100644 --- a/awc/tests/test_client.rs +++ b/awc/tests/test_client.rs @@ -722,9 +722,9 @@ async fn test_client_cookie_handling() { async fn client_unread_response() { let addr = test::unused_addr(); - std::thread::spawn(move || { - let lst = std::net::TcpListener::bind(addr).unwrap(); + let lst = std::net::TcpListener::bind(addr).unwrap(); + std::thread::spawn(move || { for stream in lst.incoming() { let mut stream = stream.unwrap(); let mut b = [0; 1000];