From 0195d09c11d2f683ffe6bf6426b59429e7300f53 Mon Sep 17 00:00:00 2001 From: Jake Shadle Date: Fri, 1 Mar 2024 12:51:25 +0100 Subject: [PATCH] Fix health_server test (#897) * Fix health_server test When running all tests in parallel with cargo nextest this would fail since the port is bound in multiple tests * Update tests/health.rs Co-authored-by: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com> --------- Co-authored-by: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com> --- tests/compress.rs | 2 ++ tests/firewall.rs | 1 + tests/health.rs | 5 ++++- tests/local_rate_limit.rs | 1 + tests/metrics.rs | 1 + tests/no_filter.rs | 1 + 6 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/compress.rs b/tests/compress.rs index 3fc7778970..cd4bdcf805 100644 --- a/tests/compress.rs +++ b/tests/compress.rs @@ -50,6 +50,7 @@ on_write: COMPRESS ); let server_proxy = quilkin::cli::Proxy { port: server_addr.port(), + qcmp_port: 0, ..<_>::default() }; // Run server proxy. @@ -76,6 +77,7 @@ on_write: DECOMPRESS ); let client_proxy = quilkin::cli::Proxy { port: client_addr.port(), + qcmp_port: 0, ..<_>::default() }; // Run client proxy. diff --git a/tests/firewall.rs b/tests/firewall.rs index 1ffb4fb13a..c92d04d003 100644 --- a/tests/firewall.rs +++ b/tests/firewall.rs @@ -215,6 +215,7 @@ async fn test( let server_proxy = quilkin::cli::Proxy { port: server_port, + qcmp_port: 0, ..<_>::default() }; let server_config = std::sync::Arc::new(quilkin::Config::default()); diff --git a/tests/health.rs b/tests/health.rs index 6e1df50279..0233fdfd83 100644 --- a/tests/health.rs +++ b/tests/health.rs @@ -32,7 +32,10 @@ async fn health_server() { }); t.run_server( server_config, - None, + Some(quilkin::Proxy { + qcmp_port: 0, + ..Default::default() + }), Some(Some((std::net::Ipv6Addr::UNSPECIFIED, 9093).into())), ) .await; diff --git a/tests/local_rate_limit.rs b/tests/local_rate_limit.rs index 8f42e07f32..5a94e62976 100644 --- a/tests/local_rate_limit.rs +++ b/tests/local_rate_limit.rs @@ -39,6 +39,7 @@ period: 1 quilkin::test::map_addr_to_localhost(&mut server_addr); let server_proxy = quilkin::cli::Proxy { port: server_addr.port(), + qcmp_port: 0, ..<_>::default() }; let server_config = std::sync::Arc::new(quilkin::Config::default()); diff --git a/tests/metrics.rs b/tests/metrics.rs index 549deb1a01..d70a9e4c1b 100644 --- a/tests/metrics.rs +++ b/tests/metrics.rs @@ -36,6 +36,7 @@ async fn metrics_server() { quilkin::test::map_addr_to_localhost(&mut server_addr); let server_proxy = quilkin::cli::Proxy { port: server_addr.port(), + qcmp_port: 0, ..<_>::default() }; let server_config = std::sync::Arc::new(quilkin::Config::default()); diff --git a/tests/no_filter.rs b/tests/no_filter.rs index ec552e1807..10ec515a80 100644 --- a/tests/no_filter.rs +++ b/tests/no_filter.rs @@ -34,6 +34,7 @@ async fn echo() { let local_addr = available_addr(&AddressType::Random).await; let server_proxy = quilkin::cli::Proxy { port: local_addr.port(), + qcmp_port: 0, ..<_>::default() }; let server_config = std::sync::Arc::new(quilkin::Config::default());