Skip to content

Commit

Permalink
don't test for file size on resize_dma_buffer
Browse files Browse the repository at this point in the history
We already test that the write is successful, and we already test that
we read what we write.

In my local machine on an ext4 filesystem, the file size never changes
after we write this. This is a metadata operation and the filesystem is
free to do this optimization AFAIR, which it likely does, especially
since this is a tmpfile that was not closed. We'd have to have a named
file and fsync() the directory to make sure the metadata always gets
updated, but I don't see the value in testing that.
  • Loading branch information
Glauber Costa authored and glommer committed Nov 23, 2023
1 parent 1f81312 commit dd38075
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions glommio/src/io/dma_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1627,9 +1627,6 @@ pub(crate) mod test {
let read = file.read_at_aligned(0, 2 * alignment).await.unwrap();
assert_eq!(read.len(), alignment);
assert!(read.iter().all(|&b| b == 1));

let stat = file.stat().await.unwrap();
assert_eq!(stat.file_size, alignment as u64, "{:?}", stat);
});

dma_file_test!(copy_file_range, path, _k, {
Expand Down

0 comments on commit dd38075

Please sign in to comment.