From 2d090d4547e09bd33cb35baa37f0566a8e6f07be Mon Sep 17 00:00:00 2001 From: Illia Bobyr Date: Fri, 5 May 2023 18:47:24 -0700 Subject: [PATCH] test_gossip_node: Use random port (#31490) Using a fixed port could cause a false negative, if the port is currently in use. We actually see this test failing regularly with an error that port `1111` is already in use. Quick search did not show any tests that hardcode port 1111, so it is unclear why is this happening. But using hardcoded ports is not a good practice anyways. --- gossip/src/cluster_info.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gossip/src/cluster_info.rs b/gossip/src/cluster_info.rs index b1da6993d2..1700228f8e 100644 --- a/gossip/src/cluster_info.rs +++ b/gossip/src/cluster_info.rs @@ -3236,7 +3236,7 @@ mod tests { )); let (node, _, _) = ClusterInfo::gossip_node( solana_sdk::pubkey::new_rand(), - &"1.1.1.1:1111".parse().unwrap(), + &"1.1.1.1:0".parse().unwrap(), 0, ); assert!(ClusterInfo::is_spy_node(