Test must flush accounts cache before calculating accounts hash from storages (#31752)

This commit is contained in:
Brooks 2023-05-23 09:39:20 -04:00 committed by GitHub
parent d866fce3d8
commit 8da91d8670
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -587,11 +587,7 @@ fn test_epoch_accounts_hash_and_warping() {
None,
);
// flush the write cache so warping can calculate the accounts hash from storages
bank_forks
.read()
.unwrap()
.working_bank()
.force_flush_accounts_cache();
bank.force_flush_accounts_cache();
let bank = bank_forks.write().unwrap().insert(Bank::warp_from_parent(
&bank,
&Pubkey::default(),
@ -624,6 +620,8 @@ fn test_epoch_accounts_hash_and_warping() {
let eah_start_offset = epoch_accounts_hash::calculation_offset_start(&bank);
let eah_start_slot_in_next_epoch =
epoch_schedule.get_first_slot_in_epoch(bank.epoch() + 1) + eah_start_offset;
// flush the write cache so warping can calculate the accounts hash from storages
bank.force_flush_accounts_cache();
let bank = bank_forks.write().unwrap().insert(Bank::warp_from_parent(
&bank,
&Pubkey::default(),