From 2694654a98a66e650f0fbf3f52db9488c2502f72 Mon Sep 17 00:00:00 2001 From: Stephen Akridge Date: Wed, 20 Mar 2019 12:24:40 -0700 Subject: [PATCH] Change fixed 8050 port to one from bind_in_range. --- core/src/cluster_info.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/cluster_info.rs b/core/src/cluster_info.rs index e3f9e7cdb..85f06a2a1 100644 --- a/core/src/cluster_info.rs +++ b/core/src/cluster_info.rs @@ -1796,11 +1796,16 @@ mod tests { #[test] fn new_with_external_ip_test_gossip() { let ip = IpAddr::V4(Ipv4Addr::from(0)); - let node = Node::new_with_external_ip(&Keypair::new().pubkey(), &socketaddr!(0, 8050)); + let port = { + bind_in_range(FULLNODE_PORT_RANGE) + .expect("Failed to bind") + .0 + }; + let node = Node::new_with_external_ip(&Keypair::new().pubkey(), &socketaddr!(0, port)); check_node_sockets(&node, ip, FULLNODE_PORT_RANGE); - assert_eq!(node.sockets.gossip.local_addr().unwrap().port(), 8050); + assert_eq!(node.sockets.gossip.local_addr().unwrap().port(), port); } #[test]