Disable rent in flaky test (#12658)
* Disable rent in test Co-authored-by: Carl Lin <carl@solana.com>
This commit is contained in:
parent
026e7de819
commit
adf6f748c0
|
@ -2396,6 +2396,14 @@ impl AccountsDB {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub fn get_append_vec_id(&self, pubkey: &Pubkey, slot: Slot) -> Option<AppendVecId> {
|
||||
let ancestors = vec![(slot, 1)].into_iter().collect();
|
||||
let accounts_index = self.accounts_index.read().unwrap();
|
||||
let result = accounts_index.get(&pubkey, Some(&ancestors), None);
|
||||
result.map(|(list, index)| list[index].1.store_id)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
@ -9333,7 +9333,25 @@ mod tests {
|
|||
&Pubkey::default(),
|
||||
),
|
||||
);
|
||||
assert_ne!(
|
||||
bank1
|
||||
.rc
|
||||
.accounts
|
||||
.accounts_db
|
||||
.get_append_vec_id(&large_account_pubkey, 1)
|
||||
.unwrap(),
|
||||
bank1
|
||||
.rc
|
||||
.accounts
|
||||
.accounts_db
|
||||
.get_append_vec_id(&zero_lamport_pubkey, 1)
|
||||
.unwrap()
|
||||
);
|
||||
|
||||
// Make sure rent collection doesn't overwrite `large_account_pubkey`, which
|
||||
// keeps slot 1 alive in the accounts database. Otherwise, slot 1 and it's bank
|
||||
// hash would be removed from accounts, preventing `rehash()` from succeeding
|
||||
bank1.lazy_rent_collection.store(true, Relaxed);
|
||||
bank1.freeze();
|
||||
let bank1_hash = bank1.hash();
|
||||
|
||||
|
|
Loading…
Reference in New Issue