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.
This commit is contained in:
Illia Bobyr 2023-05-05 18:47:24 -07:00 committed by GitHub
parent b19cc03c9a
commit 2d090d4547
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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(