From 293a5860b8ef55b3fc6eb5b5c0b12d81d3061a49 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Mon, 5 Dec 2022 13:40:14 -0600 Subject: [PATCH] test_process_stale_slot_with_budget never uses write cache (#29076) --- runtime/src/bank.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index c915df9e24..f8e7347bf3 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -14982,7 +14982,17 @@ pub(crate) mod tests { let pubkey1 = solana_sdk::pubkey::new_rand(); let pubkey2 = solana_sdk::pubkey::new_rand(); - let mut bank = create_simple_test_arc_bank(1_000_000_000); + // this test only tests non-write cache code + // Tests need to default to use write cache by default for all tests. + // Once that happens, the code this test tests can be deleted, along with this test. + let (genesis_config, _mint_keypair) = create_genesis_config(1_000_000_000); + let mut bank = Arc::new(Bank::new_with_config_for_tests( + &genesis_config, + AccountSecondaryIndexes::default(), + false, + AccountShrinkThreshold::default(), + )); + bank.restore_old_behavior_for_fragile_tests(); assert_eq!(bank.process_stale_slot_with_budget(0, 0), 0); assert_eq!(bank.process_stale_slot_with_budget(133, 0), 133);