Skip to content

Commit

Permalink
make test code more clear (solana-labs#27260)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored and haoran committed Aug 21, 2022
1 parent bbf622c commit f94f12a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5536,7 +5536,8 @@ impl AccountsDb {
.fetch_add(recycle_stores_write_elapsed.as_us(), Ordering::Relaxed);
}

pub fn flush_accounts_cache_slot(&self, slot: Slot) {
#[cfg(test)]
pub(crate) fn flush_accounts_cache_slot_for_tests(&self, slot: Slot) {
self.flush_slot_cache(slot);
}

Expand Down
6 changes: 3 additions & 3 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6436,11 +6436,11 @@ impl Bank {
}

#[cfg(test)]
pub fn flush_accounts_cache_slot(&self) {
pub fn flush_accounts_cache_slot_for_tests(&self) {
self.rc
.accounts
.accounts_db
.flush_accounts_cache_slot(self.slot())
.flush_accounts_cache_slot_for_tests(self.slot())
}

pub fn expire_old_recycle_stores(&self) {
Expand Down Expand Up @@ -14687,7 +14687,7 @@ pub(crate) mod tests {
bank1.deposit(&pubkey0, some_lamports).unwrap();
goto_end_of_slot(Arc::<Bank>::get_mut(&mut bank1).unwrap());
bank1.freeze();
bank1.flush_accounts_cache_slot();
bank1.flush_accounts_cache_slot_for_tests();

bank1.print_accounts_stats();

Expand Down

0 comments on commit f94f12a

Please sign in to comment.