patches flaky gossip pull from entrypoint test (#25589)
test_pull_from_entrypoint_if_not_present relies on a deterministic ordering for the entries when generating gossip pull requests. https://github.com/solana-labs/solana/pull/25460 changed an intermediate type for gossip pull-requests from Vec to HashMap, and so the entries are no longer deterministically ordered. This causes the test to be flaky. The commit updates the test so that it no longer relies on the ordering.
This commit is contained in:
parent
41988807d3
commit
69cbbaf483
|
@ -4083,15 +4083,15 @@ mod tests {
|
||||||
let (pings, pulls) = cluster_info.new_pull_requests(&thread_pool, None, &stakes);
|
let (pings, pulls) = cluster_info.new_pull_requests(&thread_pool, None, &stakes);
|
||||||
assert!(pings.is_empty());
|
assert!(pings.is_empty());
|
||||||
assert_eq!(pulls.len(), 2 * MIN_NUM_BLOOM_FILTERS);
|
assert_eq!(pulls.len(), 2 * MIN_NUM_BLOOM_FILTERS);
|
||||||
assert!(pulls
|
for node in [&other_node, &entrypoint] {
|
||||||
.iter()
|
assert_eq!(
|
||||||
.take(MIN_NUM_BLOOM_FILTERS)
|
pulls
|
||||||
.all(|(addr, _)| *addr == other_node.gossip));
|
.iter()
|
||||||
assert!(pulls
|
.filter(|(addr, _)| *addr == node.gossip)
|
||||||
.iter()
|
.count(),
|
||||||
.skip(MIN_NUM_BLOOM_FILTERS)
|
MIN_NUM_BLOOM_FILTERS
|
||||||
.all(|(addr, _)| *addr == entrypoint.gossip));
|
);
|
||||||
|
}
|
||||||
// Pull request 3: `other_node` is present and `entrypoint` was just pulled from. There should
|
// Pull request 3: `other_node` is present and `entrypoint` was just pulled from. There should
|
||||||
// only be one pull request to `other_node`
|
// only be one pull request to `other_node`
|
||||||
let (pings, pulls) = cluster_info.new_pull_requests(&thread_pool, None, &stakes);
|
let (pings, pulls) = cluster_info.new_pull_requests(&thread_pool, None, &stakes);
|
||||||
|
|
Loading…
Reference in New Issue