From 1484d3de70e4ca43471842d34fb29c7c3b1ec631 Mon Sep 17 00:00:00 2001 From: Arya Date: Sat, 18 May 2024 08:54:23 -0400 Subject: [PATCH] Disables several tests on Windows to avoid port conflicts (#8551) --- zebra-grpc/src/tests/snapshot.rs | 1 + zebra-grpc/src/tests/vectors.rs | 1 + .../src/peer_set/initialize/tests/vectors.rs | 2 ++ zebra-rpc/src/server/tests/vectors.rs | 1 + zebrad/tests/acceptance.rs | 14 +++++++++----- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/zebra-grpc/src/tests/snapshot.rs b/zebra-grpc/src/tests/snapshot.rs index 6b81a3c70c6..4fb589d7a3e 100644 --- a/zebra-grpc/src/tests/snapshot.rs +++ b/zebra-grpc/src/tests/snapshot.rs @@ -29,6 +29,7 @@ use crate::{ pub const ZECPAGES_SAPLING_VIEWING_KEY: &str = "zxviews1q0duytgcqqqqpqre26wkl45gvwwwd706xw608hucmvfalr759ejwf7qshjf5r9aa7323zulvz6plhttp5mltqcgs9t039cx2d09mgq05ts63n8u35hyv6h9nc9ctqqtue2u7cer2mqegunuulq2luhq3ywjcz35yyljewa4mgkgjzyfwh6fr6jd0dzd44ghk0nxdv2hnv4j5nxfwv24rwdmgllhe0p8568sgqt9ckt02v2kxf5ahtql6s0ltjpkckw8gtymxtxuu9gcr0swvz"; #[tokio::test(flavor = "multi_thread")] +#[cfg(not(target_os = "windows"))] async fn test_grpc_response_data() { let _init_guard = zebra_test::init(); diff --git a/zebra-grpc/src/tests/vectors.rs b/zebra-grpc/src/tests/vectors.rs index b34a8ec8bac..9a1bf089d88 100644 --- a/zebra-grpc/src/tests/vectors.rs +++ b/zebra-grpc/src/tests/vectors.rs @@ -26,6 +26,7 @@ pub const ZECPAGES_SAPLING_VIEWING_KEY: &str = "zxviews1q0duytgcqqqqpqre26wkl45g /// Test the gRPC methods with mocked responses #[tokio::test(flavor = "multi_thread")] +#[cfg(not(target_os = "windows"))] async fn test_grpc_methods_mocked() { let _init_guard = zebra_test::init(); diff --git a/zebra-network/src/peer_set/initialize/tests/vectors.rs b/zebra-network/src/peer_set/initialize/tests/vectors.rs index c9e0c26fb9b..57b8f4e89b4 100644 --- a/zebra-network/src/peer_set/initialize/tests/vectors.rs +++ b/zebra-network/src/peer_set/initialize/tests/vectors.rs @@ -145,6 +145,7 @@ async fn local_listener_unspecified_port_localhost_addr_v6() { /// Test that zebra-network propagates fixed localhost listener ports to the `AddressBook`. #[tokio::test] +#[cfg(not(target_os = "windows"))] async fn local_listener_fixed_port_localhost_addr_v4() { let _init_guard = zebra_test::init(); @@ -161,6 +162,7 @@ async fn local_listener_fixed_port_localhost_addr_v4() { /// Test that zebra-network propagates fixed localhost listener ports to the `AddressBook`. #[tokio::test] +#[cfg(not(target_os = "windows"))] async fn local_listener_fixed_port_localhost_addr_v6() { let _init_guard = zebra_test::init(); diff --git a/zebra-rpc/src/server/tests/vectors.rs b/zebra-rpc/src/server/tests/vectors.rs index 0f4aca010bf..26e0584777f 100644 --- a/zebra-rpc/src/server/tests/vectors.rs +++ b/zebra-rpc/src/server/tests/vectors.rs @@ -30,6 +30,7 @@ fn rpc_server_spawn_single_thread() { /// Test that the JSON-RPC server spawns when configured with multiple threads. #[test] +#[cfg(not(target_os = "windows"))] fn rpc_server_spawn_parallel_threads() { rpc_server_spawn(true) } diff --git a/zebrad/tests/acceptance.rs b/zebrad/tests/acceptance.rs index 4993e27b9ac..2c8c692d4b9 100644 --- a/zebrad/tests/acceptance.rs +++ b/zebrad/tests/acceptance.rs @@ -1395,7 +1395,7 @@ fn full_sync_testnet() -> Result<()> { ) } -#[cfg(feature = "prometheus")] +#[cfg(all(feature = "prometheus", not(target_os = "windows")))] #[tokio::test] async fn metrics_endpoint() -> Result<()> { use hyper::Client; @@ -1451,7 +1451,7 @@ async fn metrics_endpoint() -> Result<()> { Ok(()) } -#[cfg(feature = "filter-reload")] +#[cfg(all(feature = "filter-reload", not(target_os = "windows")))] #[tokio::test] async fn tracing_endpoint() -> Result<()> { use hyper::{Body, Client, Request}; @@ -1549,6 +1549,7 @@ async fn tracing_endpoint() -> Result<()> { /// Test that the JSON-RPC endpoint responds to a request, /// when configured with a single thread. #[tokio::test] +#[cfg(not(target_os = "windows"))] async fn rpc_endpoint_single_thread() -> Result<()> { rpc_endpoint(false).await } @@ -1556,6 +1557,7 @@ async fn rpc_endpoint_single_thread() -> Result<()> { /// Test that the JSON-RPC endpoint responds to a request, /// when configured with multiple threads. #[tokio::test] +#[cfg(not(target_os = "windows"))] async fn rpc_endpoint_parallel_threads() -> Result<()> { rpc_endpoint(true).await } @@ -1623,6 +1625,7 @@ async fn rpc_endpoint(parallel_cpu_threads: bool) -> Result<()> { /// /// https://zcash.github.io/rpc/getblockchaininfo.html #[tokio::test] +#[cfg(not(target_os = "windows"))] async fn rpc_endpoint_client_content_type() -> Result<()> { let _init_guard = zebra_test::init(); if zebra_test::net::zebra_skip_network_tests() { @@ -2148,6 +2151,7 @@ fn lightwalletd_integration_test(test_type: TestType) -> Result<()> { /// It is expected that the first node spawned will get exclusive use of the port. /// The second node will panic with the Zcash listener conflict hint added in #1535. #[test] +#[cfg(not(target_os = "windows"))] fn zebra_zcash_listener_conflict() -> Result<()> { let _init_guard = zebra_test::init(); @@ -2176,7 +2180,7 @@ fn zebra_zcash_listener_conflict() -> Result<()> { /// exclusive use of the port. The second node will panic with the Zcash metrics /// conflict hint added in #1535. #[test] -#[cfg(feature = "prometheus")] +#[cfg(all(feature = "prometheus", not(target_os = "windows")))] fn zebra_metrics_conflict() -> Result<()> { let _init_guard = zebra_test::init(); @@ -2205,7 +2209,7 @@ fn zebra_metrics_conflict() -> Result<()> { /// exclusive use of the port. The second node will panic with the Zcash tracing /// conflict hint added in #1535. #[test] -#[cfg(feature = "filter-reload")] +#[cfg(all(feature = "filter-reload", not(target_os = "windows")))] fn zebra_tracing_conflict() -> Result<()> { let _init_guard = zebra_test::init(); @@ -2944,7 +2948,7 @@ fn scan_task_starts() -> Result<()> { /// Test that the scanner gRPC server starts when the node starts. #[tokio::test] -#[cfg(feature = "shielded-scan")] +#[cfg(all(feature = "shielded-scan", not(target_os = "windows")))] async fn scan_rpc_server_starts() -> Result<()> { use zebra_grpc::scanner::{scanner_client::ScannerClient, Empty};