bank_forks test stability (#4959)

automerge
This commit is contained in:
Trent Nelson 2019-07-08 16:55:50 -06:00 committed by Grimes
parent eb4edd75e6
commit c5ba2e0883
1 changed files with 12 additions and 4 deletions

View File

@ -442,6 +442,15 @@ mod tests {
pub paths: String,
}
impl TempPaths {
fn remove_all(&self) {
let paths: Vec<String> = self.paths.split(',').map(|s| s.to_string()).collect();
paths.iter().for_each(|p| {
let _ignored = remove_dir_all(p);
});
}
}
#[macro_export]
macro_rules! tmp_bank_accounts_name {
() => {
@ -458,10 +467,7 @@ mod tests {
impl Drop for TempPaths {
fn drop(&mut self) {
let paths: Vec<String> = self.paths.split(',').map(|s| s.to_string()).collect();
paths.iter().for_each(|p| {
let _ignored = remove_dir_all(p);
});
self.remove_all()
}
}
@ -521,6 +527,8 @@ mod tests {
mint_keypair,
..
} = create_genesis_block(10_000);
path.remove_all();
spath.remove_all();
for index in 0..10 {
let bank0 = Bank::new_with_paths(&genesis_block, Some(path.paths.clone()));
bank0.freeze();