fix tests broken by add_root change (#29248)

This commit is contained in:
Jeff Washington (jwash) 2022-12-13 16:43:52 -06:00 committed by GitHub
parent 250ec3f2a4
commit 4ae12bf5fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -17970,6 +17970,7 @@ pub mod tests {
db.storage.map.insert(slot0, Arc::default());
assert!(!db.bank_hashes.read().unwrap().is_empty());
db.accounts_index.add_root(slot0);
db.accounts_index.add_uncleaned_roots([slot0].into_iter());
assert!(db.accounts_index.is_uncleaned_root(slot0));
assert!(db.accounts_index.is_alive_root(slot0));
db.handle_dropped_roots_for_ancient(dropped_roots);

View File

@ -3139,6 +3139,7 @@ pub mod tests {
assert_eq!(0, index.roots_tracker.read().unwrap().uncleaned_roots.len());
index.add_root(0);
index.add_root(1);
index.add_uncleaned_roots([0, 1].into_iter());
assert_eq!(2, index.roots_tracker.read().unwrap().uncleaned_roots.len());
assert_eq!(
@ -3165,6 +3166,7 @@ pub mod tests {
index.add_root(2);
index.add_root(3);
index.add_uncleaned_roots([2, 3].into_iter());
assert_eq!(4, index.roots_tracker.read().unwrap().alive_roots.len());
assert_eq!(2, index.roots_tracker.read().unwrap().uncleaned_roots.len());
assert_eq!(