fixes test_filter_current flakiness (bp #14749) (#14760)

* fixes test_filter_current flakiness (#14749)

(cherry picked from commit e4da6761a7)

# Conflicts:
#	core/src/crds_value.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
This commit is contained in:
mergify[bot]
2021-01-22 01:17:59 +00:00
committed by GitHub
parent 24665ef7fb
commit 4a6f17fb2d

View File

@ -644,6 +644,8 @@ mod test {
use super::*;
use crate::contact_info::ContactInfo;
use bincode::deserialize;
use rand::SeedableRng;
use rand_chacha::ChaChaRng;
use solana_perf::test_tx::test_tx;
use solana_sdk::signature::{Keypair, Signer};
use solana_sdk::timing::timestamp;
@ -822,7 +824,8 @@ mod test {
#[test]
fn test_filter_current() {
let mut rng = rand::thread_rng();
let seed = [48u8; 32];
let mut rng = ChaChaRng::from_seed(seed);
let keys: Vec<_> = repeat_with(Keypair::new).take(16).collect();
let values: Vec<_> = repeat_with(|| {
let index = rng.gen_range(0, keys.len());