test_clean_multiple_zero_lamport_decrements_index_ref_count uses write cache (#29088)
This commit is contained in:
parent
fe8b15b43a
commit
94a6665995
|
@ -11693,7 +11693,8 @@ pub mod tests {
|
||||||
fn test_clean_multiple_zero_lamport_decrements_index_ref_count() {
|
fn test_clean_multiple_zero_lamport_decrements_index_ref_count() {
|
||||||
solana_logger::setup();
|
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 pubkey1 = solana_sdk::pubkey::new_rand();
|
||||||
let pubkey2 = solana_sdk::pubkey::new_rand();
|
let pubkey2 = solana_sdk::pubkey::new_rand();
|
||||||
let zero_lamport_account =
|
let zero_lamport_account =
|
||||||
|
@ -11705,9 +11706,12 @@ pub mod tests {
|
||||||
accounts.store_for_tests(1, &[(&pubkey1, &zero_lamport_account)]);
|
accounts.store_for_tests(1, &[(&pubkey1, &zero_lamport_account)]);
|
||||||
accounts.store_for_tests(2, &[(&pubkey1, &zero_lamport_account)]);
|
accounts.store_for_tests(2, &[(&pubkey1, &zero_lamport_account)]);
|
||||||
// Root all slots
|
// Root all slots
|
||||||
accounts.add_root(0);
|
accounts.get_accounts_delta_hash(0);
|
||||||
accounts.add_root(1);
|
accounts.add_root_and_flush_write_cache(0);
|
||||||
accounts.add_root(2);
|
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 ref counts should match how many slots they were stored in
|
||||||
// Account 1 = 3 slots; account 2 = 1 slot
|
// Account 1 = 3 slots; account 2 = 1 slot
|
||||||
|
|
Loading…
Reference in New Issue