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 Dec 12, 2022
1 parent 9ac2281 commit 8db5357
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions runtime/src/snapshot_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2716,6 +2716,7 @@ pub fn verify_snapshot_archive<P, Q, R>(
if let VerifyBank::NonDeterministic(slot) = verify_bank {
// file contents may be different, but deserialized structs should be equal
let slot = slot.to_string();
let snapshot_slot_dir = snapshots_to_verify.as_ref().join(&slot);
let p1 = snapshots_to_verify.as_ref().join(&slot).join(&slot);
let p2 = unpacked_snapshots.join(&slot).join(&slot);

Expand All @@ -2738,6 +2739,17 @@ pub fn verify_snapshot_archive<P, Q, R>(
new_unpacked_status_cache_file,
)
.unwrap();

// Remove the new accounts/ and state_complete file to be consistent with the
// old archive structure.
let accounts_path = snapshot_slot_dir.join("accounts");
if accounts_path.is_dir() {
std::fs::remove_dir_all(accounts_path).unwrap();
}
let state_complete_path = snapshot_slot_dir.join("state_complete");
if state_complete_path.is_file() {
std::fs::remove_file(state_complete_path).unwrap();
}
}

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

0 comments on commit 8db5357

Please sign in to comment.