Skip to content

Commit

Permalink
fix tests broken by add_root change (#29248)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored Dec 13, 2022
1 parent 250ec3f commit 4ae12bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions runtime/src/accounts_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand All @@ -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!(
Expand Down

0 comments on commit 4ae12bf

Please sign in to comment.