diff --git a/Cargo.lock b/Cargo.lock index 4dc947bcb..f5fa8a5b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1993,14 +1993,12 @@ dependencies = [ [[package]] name = "mockito" -version = "0.32.4" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fa08cccbc31b07113e4322d79df4464e0ed888032fc67ec56136325cd3afecf" +checksum = "8c1eecc3baf782e3c8d6803cc8780268da1f32df6eb88c016c1d80b0df7944cf" dependencies = [ "assert-json-diff", - "async-trait", "colored", - "deadpool", "futures", "hyper", "lazy_static", diff --git a/aggregator/Cargo.toml b/aggregator/Cargo.toml index 67bfbd4fa..4c40a5ef0 100644 --- a/aggregator/Cargo.toml +++ b/aggregator/Cargo.toml @@ -92,7 +92,7 @@ hyper = "0.14.25" # Kubernetes clusters. Enable the `test-util` feature for various utilities # used in unit tests. janus_aggregator = { path = ".", features = ["kube-openssl", "test-util"] } -mockito = "0.32.4" +mockito = "1.0.0" tempfile = "3.4.0" tokio = { version = "1", features = ["test-util"] } # ensure this remains compatible with the non-dev dependency trycmd = "0.14.13" diff --git a/aggregator/src/aggregator.rs b/aggregator/src/aggregator.rs index 9b885c277..b568b603a 100644 --- a/aggregator/src/aggregator.rs +++ b/aggregator/src/aggregator.rs @@ -8191,7 +8191,9 @@ mod tests { .await; // Serve the response via mockito, and run it through post_to_helper's error handling. - let mut server = mockito::Server::new_async().await; + // Workaround: use `new_with_port_async` to skip Mockito's server pool, which + // has a bug in 1.0.0. + let mut server = mockito::Server::new_with_port_async(0).await; let error_mock = server .mock("POST", "/") .with_status(response.status().as_u16().into()) diff --git a/client/Cargo.toml b/client/Cargo.toml index 25168590f..da4458630 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -27,6 +27,6 @@ url = "2.3.1" [dev-dependencies] assert_matches = "1" janus_core = { path = "../core", features = ["test-util"]} -mockito = "0.32.4" +mockito = "1.0.0" tracing-log = "0.1.3" tracing-subscriber = { version = "0.3", features = ["std", "env-filter", "fmt"] } diff --git a/collector/Cargo.toml b/collector/Cargo.toml index 38c286c84..f4141565d 100644 --- a/collector/Cargo.toml +++ b/collector/Cargo.toml @@ -34,7 +34,7 @@ chrono = "0.4" clap = { version = "4.0.27", features = ["derive", "env"] } janus_collector = { path = ".", features = ["test-util"] } janus_core = { path = "../core", features = ["test-util"] } -mockito = "0.32.4" +mockito = "1.0.0" rand = "0.8" tracing-log = "0.1.3" tracing-subscriber = { version = "0.3", features = ["std", "env-filter", "fmt"] } diff --git a/core/Cargo.toml b/core/Cargo.toml index 691992766..5321b80f5 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -62,6 +62,6 @@ janus_core = { path = ".", features = ["test-util"] } # lack of support for connecting to servers by IP addresses, which affects many # Kubernetes clusters. kube = { workspace = true, features = ["openssl-tls"] } -mockito = "0.32.4" +mockito = "1.0.0" serde_test = "1.0.155" url = "2.3.1" diff --git a/core/src/retries.rs b/core/src/retries.rs index d85387d22..4d06a22ec 100644 --- a/core/src/retries.rs +++ b/core/src/retries.rs @@ -44,7 +44,7 @@ pub fn test_http_request_exponential_backoff() -> ExponentialBackoff { initial_interval: Duration::from_nanos(1), max_interval: Duration::from_nanos(30), multiplier: 2.0, - max_elapsed_time: Some(Duration::from_millis(10)), + max_elapsed_time: Some(Duration::from_millis(100)), ..Default::default() } }