Skip to content

Commit 5210fef

Browse files
authored
Run tests with accounts cache cleaning (anza-xyz#10093)
1 parent 7f06669 commit 5210fef

File tree

4 files changed

+3
-14
lines changed

4 files changed

+3
-14
lines changed

accounts-db/benches/accounts.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,7 @@ where
8686
.collect();
8787
let storable_accounts: Vec<_> = pubkeys.iter().zip(accounts_data.iter()).collect();
8888
accounts.store_accounts_par((slot, storable_accounts.as_slice()), None);
89-
accounts.add_root(slot);
90-
accounts
91-
.accounts_db
92-
.flush_accounts_cache_slot_for_tests(slot);
89+
accounts.accounts_db.add_root_and_flush_write_cache(slot);
9390

9491
let pubkeys = Arc::new(pubkeys);
9592
for i in 0..num_readers {

runtime/src/bank.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6043,14 +6043,6 @@ impl Bank {
60436043
self.try_process_entry_transactions(txs).unwrap()
60446044
}
60456045

6046-
#[cfg(test)]
6047-
pub fn flush_accounts_cache_slot_for_tests(&self) {
6048-
self.rc
6049-
.accounts
6050-
.accounts_db
6051-
.flush_accounts_cache_slot_for_tests(self.slot())
6052-
}
6053-
60546046
pub fn get_sysvar_cache_for_tests(&self) -> SysvarCache {
60556047
self.transaction_processor.get_sysvar_cache_for_tests()
60566048
}

runtime/src/bank/serde_snapshot.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ mod tests {
174174

175175
fn add_root_and_flush_write_cache(bank: &Bank) {
176176
bank.rc.accounts.add_root(bank.slot());
177-
bank.flush_accounts_cache_slot_for_tests()
177+
bank.force_flush_accounts_cache();
178178
}
179179

180180
#[test_case(#[allow(deprecated)] StorageAccess::Mmap)]

runtime/src/bank/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5718,7 +5718,7 @@ fn test_add_builtin_account() {
57185718
/// to use the write cache
57195719
fn add_root_and_flush_write_cache(bank: &Bank) {
57205720
bank.rc.accounts.add_root(bank.slot());
5721-
bank.flush_accounts_cache_slot_for_tests()
5721+
bank.force_flush_accounts_cache();
57225722
}
57235723

57245724
#[test]

0 commit comments

Comments
 (0)