fix bench db wipe
@@ -178,6 +178,7 @@ impl<B: BlockT> BenchmarkingState<B> {
fn wipe_tracker(&self) {
*self.main_key_tracker.borrow_mut() = HashMap::new();
+ *self.child_key_tracker.borrow_mut() = HashMap::new();
self.add_whitelist_to_tracker();
*self.read_write_tracker.borrow_mut() = Default::default();
}
@@ -512,6 +513,7 @@ mod test {
let bench_state = BenchmarkingState::<crate::tests::Block>::new(Default::default(), None)
.unwrap();
+ for _ in 0..2 {
let child1 = sp_core::storage::ChildInfo::new_default(b"child1");
let child2 = sp_core::storage::ChildInfo::new_default(b"child2");
@@ -539,5 +541,8 @@ mod test {
assert_eq!(rw_tracker.repeat_reads, 0);
assert_eq!(rw_tracker.writes, 2);
assert_eq!(rw_tracker.repeat_writes, 0);
+ drop(rw_tracker);
+ bench_state.wipe().unwrap();
+ }
}
}
