From 8da91d867078bde75d58326413a8c4e4dd7763ea Mon Sep 17 00:00:00 2001 From: Brooks Date: Tue, 23 May 2023 09:39:20 -0400 Subject: [PATCH] Test must flush accounts cache before calculating accounts hash from storages (#31752) --- core/tests/epoch_accounts_hash.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/tests/epoch_accounts_hash.rs b/core/tests/epoch_accounts_hash.rs index df0d407df7..51809cfb6a 100755 --- a/core/tests/epoch_accounts_hash.rs +++ b/core/tests/epoch_accounts_hash.rs @@ -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(),