Skip to content

Commit

Permalink
Fix test_concurrent_snapshot_packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangzhu70 committed Jan 3, 2023
1 parent 46703b8 commit ec592c6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions runtime/src/snapshot_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2043,6 +2043,22 @@ pub fn verify_snapshot_archive<P, Q, R>(
assert!(crate::serde_snapshot::compare_two_serialized_banks(&p1, &p2).unwrap());
std::fs::remove_file(p1).unwrap();
std::fs::remove_file(p2).unwrap();

// The new the status_cache file is inside the slot directory together with the snapshot file.
// When unpacking an archive, the status_cache file from the archive is one-level up outside of
// the slot direcotry.
// The unpacked status_cache file need to be put back into the slot directory for the directory
// comparison to pass.
let existing_unpacked_status_cache_file =
unpacked_snapshots.join(SNAPSHOT_STATUS_CACHE_FILENAME);
let new_unpacked_status_cache_file = unpacked_snapshots
.join(&slot)
.join(SNAPSHOT_STATUS_CACHE_FILENAME);
fs::rename(
existing_unpacked_status_cache_file,
new_unpacked_status_cache_file,
)
.unwrap();
}

assert!(!dir_diff::is_different(&snapshots_to_verify, unpacked_snapshots).unwrap());
Expand Down

0 comments on commit ec592c6

Please sign in to comment.