-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Description
Hey, as in issue title. I wanted to test that a service gracefully handles networking issues like server being temporarily unreachable and wanted to do that by dropping the MockServer
, however this loop actually never finishes:
use std::time::Duration;
use tokio::{net::TcpStream, time::sleep};
use wiremock::MockServer;
#[tokio::main]
async fn main() {
let server = MockServer::start().await;
let addr = *server.address();
drop(server);
loop {
if TcpStream::connect(addr).await.is_err() {
break;
}
sleep(Duration::from_millis(200)).await;
println!("retrying");
}
}
Metadata
Metadata
Assignees
Labels
No labels