nit removal (#10721)

This commit is contained in:
Kristofer Peterson
2020-06-21 08:12:21 +01:00
committed by GitHub
parent a33fef9af2
commit a87f490b5e

View File

@ -312,7 +312,7 @@ mod tests {
if slot == saved_slot as u64 { if slot == saved_slot as u64 {
let options = CopyOptions::new(); let options = CopyOptions::new();
fs_extra::dir::copy(accounts_dir, &saved_accounts_dir, &options).unwrap(); fs_extra::dir::copy(accounts_dir, &saved_accounts_dir, &options).unwrap();
let snapshot_paths = fs::read_dir(snapshot_path) let last_snapshot_path = fs::read_dir(snapshot_path)
.unwrap() .unwrap()
.filter_map(|entry| { .filter_map(|entry| {
let e = entry.unwrap(); let e = entry.unwrap();
@ -327,7 +327,7 @@ mod tests {
.last() .last()
.unwrap(); .unwrap();
// only save off the snapshot of this slot, we don't need the others. // only save off the snapshot of this slot, we don't need the others.
fs_extra::dir::copy(&snapshot_paths, &saved_snapshots_dir, &options).unwrap(); fs_extra::dir::copy(&last_snapshot_path, &saved_snapshots_dir, &options).unwrap();
saved_archive_path = Some(snapshot_utils::get_snapshot_archive_path( saved_archive_path = Some(snapshot_utils::get_snapshot_archive_path(
snapshot_package_output_path, snapshot_package_output_path,
@ -340,13 +340,10 @@ mod tests {
// Purge all the outdated snapshots, including the ones needed to generate the package // Purge all the outdated snapshots, including the ones needed to generate the package
// currently sitting in the channel // currently sitting in the channel
bank_forks.purge_old_snapshots(); bank_forks.purge_old_snapshots();
assert_eq!( assert!(snapshot_utils::get_snapshot_paths(&snapshots_dir)
snapshot_utils::get_snapshot_paths(&snapshots_dir)
.into_iter() .into_iter()
.map(|path| path.slot) .map(|path| path.slot)
.eq(3..=MAX_CACHE_ENTRIES as u64 + 2), .eq(3..=MAX_CACHE_ENTRIES as u64 + 2));
true
);
// Create a SnapshotPackagerService to create tarballs from all the pending // Create a SnapshotPackagerService to create tarballs from all the pending
// SnapshotPackage's on the channel. By the time this service starts, we have already // SnapshotPackage's on the channel. By the time this service starts, we have already
@ -434,10 +431,7 @@ mod tests {
.unwrap() .unwrap()
.src .src
.roots(); .roots();
assert_eq!( assert!(slots_to_snapshot.into_iter().eq(expected_slots_to_snapshot));
slots_to_snapshot.into_iter().eq(expected_slots_to_snapshot),
true
);
} }
} }