(cherry picked from commit a87f490b5e
)
Co-authored-by: Kristofer Peterson <svenski123@users.noreply.github.com>
This commit is contained in:
@ -315,7 +315,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();
|
||||||
@ -330,7 +330,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,
|
||||||
@ -343,13 +343,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
|
||||||
@ -437,10 +434,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
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user