Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Set ticks_per_slot higher for banking stage tests (#16094) (#16356)
Browse files Browse the repository at this point in the history
Tests are timing out because the bank hit the MaxTickHeight and
will not process the transactions.

(cherry picked from commit 96ccc40)

Co-authored-by: sakridge <sakridge@gmail.com>
  • Loading branch information
mergify[bot] and sakridge authored Apr 4, 2021
1 parent f1bc7ec commit 553e9fb
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions core/src/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,7 @@ mod tests {
genesis_config,
mint_keypair,
..
} = create_genesis_config(10);
} = create_slow_genesis_config(10);
let bank = Arc::new(Bank::new_no_wallclock_throttle(&genesis_config));
let start_hash = bank.last_blockhash();
let (verified_sender, verified_receiver) = unbounded();
Expand Down Expand Up @@ -1596,7 +1596,7 @@ mod tests {
genesis_config,
mint_keypair,
..
} = create_genesis_config(2);
} = create_slow_genesis_config(2);
let (verified_sender, verified_receiver) = unbounded();

// Process a batch that includes a transaction that receives two lamports.
Expand Down Expand Up @@ -2027,14 +2027,21 @@ mod tests {
);
}

fn create_slow_genesis_config(lamports: u64) -> GenesisConfigInfo {
let mut config_info = create_genesis_config(lamports);
// For these tests there's only 1 slot, don't want to run out of ticks
config_info.genesis_config.ticks_per_slot *= 8;
config_info
}

#[test]
fn test_bank_process_and_record_transactions() {
solana_logger::setup();
let GenesisConfigInfo {
genesis_config,
mint_keypair,
..
} = create_genesis_config(10_000);
} = create_slow_genesis_config(10_000);
let bank = Arc::new(Bank::new(&genesis_config));
let pubkey = solana_sdk::pubkey::new_rand();

Expand Down Expand Up @@ -2161,7 +2168,7 @@ mod tests {
genesis_config,
mint_keypair,
..
} = create_genesis_config(10_000);
} = create_slow_genesis_config(10_000);
let bank = Arc::new(Bank::new(&genesis_config));
let pubkey = solana_sdk::pubkey::new_rand();
let pubkey1 = solana_sdk::pubkey::new_rand();
Expand Down Expand Up @@ -2268,7 +2275,7 @@ mod tests {
genesis_config,
mint_keypair,
..
} = create_genesis_config(10_000);
} = create_slow_genesis_config(10_000);
let bank = Arc::new(Bank::new_no_wallclock_throttle(&genesis_config));

let pubkey = solana_sdk::pubkey::new_rand();
Expand Down Expand Up @@ -2334,7 +2341,7 @@ mod tests {
genesis_config,
mint_keypair,
..
} = create_genesis_config(10_000);
} = create_slow_genesis_config(10_000);
let bank = Arc::new(Bank::new(&genesis_config));
let pubkey = solana_sdk::pubkey::new_rand();
let pubkey1 = solana_sdk::pubkey::new_rand();
Expand Down Expand Up @@ -2455,7 +2462,7 @@ mod tests {
Arc<AtomicBool>,
) {
Blockstore::destroy(&ledger_path).unwrap();
let genesis_config_info = create_genesis_config(10_000);
let genesis_config_info = create_slow_genesis_config(10_000);
let GenesisConfigInfo {
genesis_config,
mint_keypair,
Expand Down

0 comments on commit 553e9fb

Please sign in to comment.