Skip to content

Commit

Permalink
fixup! avm: force file sync (#1457) (#1460)
Browse files Browse the repository at this point in the history
  • Loading branch information
steviez authored Feb 17, 2022
1 parent 222c6e3 commit 727a5a1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions avm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ mod tests {
let mut current_version_file =
fs::File::create(current_version_file_path().as_path()).unwrap();
current_version_file.write_all("0.18.2".as_bytes()).unwrap();
// Sync the file to disk before the read in current_version() to
// mitigate the read not seeing the written version bytes.
current_version_file.sync_all().unwrap();
// Create a fake binary for anchor-0.18.2 in the bin directory
fs::File::create(version_binary_path(&version)).unwrap();
uninstall_version(&version).unwrap();
Expand Down

0 comments on commit 727a5a1

Please sign in to comment.