diff --git a/fs-storage/src/file_storage.rs b/fs-storage/src/file_storage.rs index 93c8b461..27f93f3f 100644 --- a/fs-storage/src/file_storage.rs +++ b/fs-storage/src/file_storage.rs @@ -375,16 +375,24 @@ mod tests { .expect("Failed to write to file"); file.flush().expect("Failed to flush file"); + // Drop the file handle + drop(file); + let timestamp_before = fs::metadata(&storage_path) .expect("Failed to get metadata") .modified() .expect("Failed to get modified time"); + let mut file = + fs::File::create(&storage_path).expect("Failed to create file"); // write to the file again file.write_all(b"test2") .expect("Failed to write to file"); file.flush().expect("Failed to flush file"); + // Drop the file handle + drop(file); + let timestamp_after = fs::metadata(&storage_path) .expect("Failed to get metadata") .modified()