test_clean_multiple_zero_lamport_decrements_index_ref_count uses write cache (#29088)

This commit is contained in:
Jeff Washington (jwash) 2022-12-06 10:56:37 -06:00 committed by GitHub
parent fe8b15b43a
commit 94a6665995
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -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