Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
grandpa: reduce variance in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andresilva committed Jun 16, 2021
1 parent 2604c25 commit 36d2578
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/finality-grandpa/src/communication/gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2474,15 +2474,15 @@ mod tests {
// `sqrt(peers)` we're connected to, but we guarantee that at least 4 of
// those peers are authorities (plus the `LUCKY_PEERS` from the previous
// stage)
assert!(trial(test(PROPAGATION_SOME, &authorities)) >= LUCKY_PEERS);
assert!(trial(test(PROPAGATION_SOME * 1.1, &authorities)) >= LUCKY_PEERS);
assert_eq!(
trial(test(2.0, &all_peers)),
LUCKY_PEERS + (all_peers.len() as f64).sqrt() as usize,
);

// after 3 rounds durations we should gossip to all peers we are
// connected to
assert_eq!(trial(test(PROPAGATION_ALL, &all_peers)), all_peers.len(),);
assert_eq!(trial(test(PROPAGATION_ALL * 1.1, &all_peers)), all_peers.len());
}

#[test]
Expand Down

0 comments on commit 36d2578

Please sign in to comment.