diff --git a/core/tests/epoch_accounts_hash.rs b/core/tests/epoch_accounts_hash.rs index dbb1ee6f9e..a43cb733e2 100755 --- a/core/tests/epoch_accounts_hash.rs +++ b/core/tests/epoch_accounts_hash.rs @@ -123,7 +123,8 @@ impl TestEnvironment { SocketAddrSpace::Unspecified, )); - let (pruned_banks_sender, pruned_banks_receiver) = crossbeam_channel::unbounded(); + let pruned_banks_receiver = + AccountsBackgroundService::setup_bank_drop_callback(Arc::clone(&bank_forks)); let background_services = BackgroundServices::new( Arc::clone(&exit), Arc::clone(&cluster_info), @@ -132,12 +133,6 @@ impl TestEnvironment { Arc::clone(&bank_forks), ); let bank = bank_forks.read().unwrap().working_bank(); - bank.set_callback(Some(Box::new( - bank.rc - .accounts - .accounts_db - .create_drop_bank_callback(pruned_banks_sender), - ))); assert!(bank .feature_set .is_active(&feature_set::epoch_accounts_hash::id())); @@ -159,7 +154,7 @@ impl TestEnvironment { /// In order to shut down the background services correctly, each service's thread must be joined. /// However, since `.join()` takes a `self` and `drop()` takes a `&mut self`, it means a "normal" -/// implementation of drop will no work. Instead, we must handle drop ourselves. +/// implementation of drop will not work. Instead, we must handle drop ourselves. struct BackgroundServices { exit: Arc, accounts_background_service: ManuallyDrop,