diff --git a/tests/server.rs b/tests/server.rs index dc6a672..0fdfc8c 100644 --- a/tests/server.rs +++ b/tests/server.rs @@ -116,7 +116,21 @@ impl TestServer { } fn request(&self, method: &str, path: &str, body: &[u8], content_type: &str) -> Response { - send(self.port, method, path, body, content_type).expect("HTTP request") + match send(self.port, method, path, body, content_type) { + Ok(response) => response, + Err(first) => { + std::thread::sleep(Duration::from_millis(200)); + match send(self.port, method, path, body, content_type) { + Ok(response) => response, + Err(second) => panic!( + "HTTP request failed twice: {first}; {second} +server log: +{}", + self.log() + ), + } + } + } } fn get(&self, path: &str) -> Response {