You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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]asyncfnmain(){let server = MockServer::start().await;let addr = *server.address();drop(server);loop{ifTcpStream::connect(addr).await.is_err(){break;}sleep(Duration::from_millis(200)).await;println!("retrying");}}
The text was updated successfully, but these errors were encountered:
Wanted to work on this issue and it turned out that this bug is actually an undocumented feature. I found this comment too
/// `wiremock`'s pooling is designed to be an invisible optimisation: users of the crate, if/// we are successful, should never have to reason about it.
Would you consider a PR which mentions about the difference in behavior on MockServer::start and MockServer::builder? Builder avoids pooling and was what I was actually looking for in this particular test, but I had to find it out by reading code
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:The text was updated successfully, but these errors were encountered: