fixes test_filter_current flakiness (#14749)

This commit is contained in:
behzad nouri 2021-01-21 21:53:10 +00:00 committed by GitHub
parent 3c6dbd21d2
commit e4da6761a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -675,6 +675,8 @@ mod test {
use super::*;
use crate::contact_info::ContactInfo;
use bincode::{deserialize, Options};
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;
@ -843,7 +845,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());