use std::{
fs::File,
io::{self, Write},
path::Path,
};
pub(crate) fn write_synced(path: &Path, bytes: &[u8]) -> io::Result<File> {
let mut file = File::create(path)?;
file.write_all(bytes)?;
file.sync_all()?;
File::open(path.parent().expect("fixture reply has a parent"))?.sync_all()?;
Ok(file)
}