From cbcc4f8595e7793ec0e24ec33ff7c287022f3e6b Mon Sep 17 00:00:00 2001 From: carllin Date: Mon, 5 Apr 2021 19:40:16 -0700 Subject: [PATCH] No wallclock throttle tests (#16396) (cherry picked from commit 1219842a9661ae30905100d0eb6931f1455ea2cb) # Conflicts: # core/src/banking_stage.rs --- core/src/banking_stage.rs | 26 +++++++++++++++++++++++--- core/src/poh_service.rs | 2 +- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/core/src/banking_stage.rs b/core/src/banking_stage.rs index 6665c5b26f2773..a0f5a4a62cc706 100644 --- a/core/src/banking_stage.rs +++ b/core/src/banking_stage.rs @@ -1356,7 +1356,7 @@ mod tests { #[test] fn test_banking_stage_shutdown1() { let genesis_config = create_genesis_config(2).genesis_config; - let bank = Arc::new(Bank::new(&genesis_config)); + let bank = Arc::new(Bank::new_no_wallclock_throttle(&genesis_config)); let (verified_sender, verified_receiver) = unbounded(); let (vote_sender, vote_receiver) = unbounded(); let (gossip_vote_sender, _gossip_vote_receiver) = unbounded(); @@ -1395,7 +1395,7 @@ mod tests { } = create_genesis_config(2); genesis_config.ticks_per_slot = 4; let num_extra_ticks = 2; - let bank = Arc::new(Bank::new(&genesis_config)); + let bank = Arc::new(Bank::new_no_wallclock_throttle(&genesis_config)); let start_hash = bank.last_blockhash(); let (verified_sender, verified_receiver) = unbounded(); let (vote_sender, vote_receiver) = unbounded(); @@ -1681,7 +1681,7 @@ mod tests { mint_keypair, .. } = create_genesis_config(10_000); - let bank = Arc::new(Bank::new(&genesis_config)); + let bank = Arc::new(Bank::new_no_wallclock_throttle(&genesis_config)); let start = Arc::new(Instant::now()); let working_bank = WorkingBank { bank: bank.clone(), @@ -2022,8 +2022,13 @@ mod tests { genesis_config, mint_keypair, .. +<<<<<<< HEAD } = create_genesis_config(10_000); let bank = Arc::new(Bank::new(&genesis_config)); +======= + } = create_slow_genesis_config(10_000); + let bank = Arc::new(Bank::new_no_wallclock_throttle(&genesis_config)); +>>>>>>> 1219842a9... No wallclock throttle tests (#16396) let pubkey = solana_sdk::pubkey::new_rand(); let transactions = vec![system_transaction::transfer( @@ -2121,8 +2126,13 @@ mod tests { genesis_config, mint_keypair, .. +<<<<<<< HEAD } = create_genesis_config(10_000); let bank = Arc::new(Bank::new(&genesis_config)); +======= + } = create_slow_genesis_config(10_000); + let bank = Arc::new(Bank::new_no_wallclock_throttle(&genesis_config)); +>>>>>>> 1219842a9... No wallclock throttle tests (#16396) let pubkey = solana_sdk::pubkey::new_rand(); let pubkey1 = solana_sdk::pubkey::new_rand(); @@ -2282,8 +2292,13 @@ mod tests { genesis_config, mint_keypair, .. +<<<<<<< HEAD } = create_genesis_config(10_000); let bank = Arc::new(Bank::new(&genesis_config)); +======= + } = create_slow_genesis_config(10_000); + let bank = Arc::new(Bank::new_no_wallclock_throttle(&genesis_config)); +>>>>>>> 1219842a9... No wallclock throttle tests (#16396) let pubkey = solana_sdk::pubkey::new_rand(); let pubkey1 = solana_sdk::pubkey::new_rand(); let keypair1 = Keypair::new(); @@ -2402,8 +2417,13 @@ mod tests { } = &genesis_config_info; let blockstore = Blockstore::open(&ledger_path).expect("Expected to be able to open database ledger"); +<<<<<<< HEAD let bank = Arc::new(Bank::new(&genesis_config)); let (poh_recorder, entry_receiver) = PohRecorder::new( +======= + let bank = Arc::new(Bank::new_no_wallclock_throttle(&genesis_config)); + let (poh_recorder, entry_receiver, record_receiver) = PohRecorder::new( +>>>>>>> 1219842a9... No wallclock throttle tests (#16396) bank.tick_height(), bank.last_blockhash(), bank.slot(), diff --git a/core/src/poh_service.rs b/core/src/poh_service.rs index de152a68ef76cf..3bc03ff423c93a 100644 --- a/core/src/poh_service.rs +++ b/core/src/poh_service.rs @@ -180,7 +180,7 @@ mod tests { fn test_poh_service() { solana_logger::setup(); let GenesisConfigInfo { genesis_config, .. } = create_genesis_config(2); - let bank = Arc::new(Bank::new(&genesis_config)); + let bank = Arc::new(Bank::new_no_wallclock_throttle(&genesis_config)); let prev_hash = bank.last_blockhash(); let ledger_path = get_tmp_ledger_path!(); {