From 4faf4c9d203a096d6977aa3a866557000590ff5d Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" <75863576+jeffwashington@users.noreply.github.com> Date: Wed, 1 Sep 2021 21:52:16 -0500 Subject: [PATCH] add debugging to test (#19563) * add debugging to test * update cargo --- Cargo.lock | 4 ++-- runtime/src/accounts_db.rs | 6 ++---- runtime/src/accounts_index.rs | 6 ++++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 37e0d40eda1bf3..e12461eb5f260f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5530,7 +5530,7 @@ dependencies = [ "bincode", "chrono", "crossbeam-channel", - "futures 0.3.16", + "futures 0.3.17", "futures-util", "log 0.4.14", "prost", @@ -5541,7 +5541,7 @@ dependencies = [ "solana-rpc", "solana-runtime", "solana-sdk", - "tokio 1.10.1", + "tokio 1.11.0", "tonic", "tonic-build", ] diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index e1293bced57178..a0defff1e34f17 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -12181,10 +12181,8 @@ pub mod tests { assert!(db.storage.get_slot_storage_entries(*slot).is_none()); assert!(db.accounts_cache.slot_cache(*slot).is_none()); let account_in_slot = slot_to_pubkey_map[slot]; - assert!(db - .accounts_index - .get_account_read_entry(&account_in_slot) - .is_none()); + let item = db.accounts_index.get_account_read_entry(&account_in_slot); + assert!(item.is_none(), "item: {:?}", item); } // Wait for flush to finish before starting next trial diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index af80249f8066d3..782944eaf1a37b 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -133,6 +133,12 @@ pub struct ReadAccountMapEntry { slot_list_guard: RwLockReadGuard<'this, SlotList>, } +impl Debug for ReadAccountMapEntry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(f, "{:?}", self.borrow_owned_entry()) + } +} + impl ReadAccountMapEntry { pub fn from_account_map_entry(account_map_entry: AccountMapEntry) -> Self { ReadAccountMapEntryBuilder {