From 94a66659952a98ebc1f19f9a0733ab158f5b9769 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Tue, 6 Dec 2022 10:56:37 -0600 Subject: [PATCH] test_clean_multiple_zero_lamport_decrements_index_ref_count uses write cache (#29088) --- runtime/src/accounts_db.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index b657b95a5..fb4336686 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -11693,7 +11693,8 @@ pub mod tests { fn test_clean_multiple_zero_lamport_decrements_index_ref_count() { solana_logger::setup(); - let accounts = AccountsDb::new(Vec::new(), &ClusterType::Development); + let mut accounts = AccountsDb::new(Vec::new(), &ClusterType::Development); + accounts.caching_enabled = true; let pubkey1 = solana_sdk::pubkey::new_rand(); let pubkey2 = solana_sdk::pubkey::new_rand(); let zero_lamport_account = @@ -11705,9 +11706,12 @@ pub mod tests { accounts.store_for_tests(1, &[(&pubkey1, &zero_lamport_account)]); accounts.store_for_tests(2, &[(&pubkey1, &zero_lamport_account)]); // Root all slots - accounts.add_root(0); - accounts.add_root(1); - accounts.add_root(2); + accounts.get_accounts_delta_hash(0); + accounts.add_root_and_flush_write_cache(0); + accounts.get_accounts_delta_hash(1); + accounts.add_root_and_flush_write_cache(1); + accounts.get_accounts_delta_hash(2); + accounts.add_root_and_flush_write_cache(2); // Account ref counts should match how many slots they were stored in // Account 1 = 3 slots; account 2 = 1 slot