tweak comment and use a weaker fence

This commit is contained in:
Ralf Jung
2025-06-01 16:27:27 +02:00
parent b88cbed741
commit 0884c683ad
@@ -21,7 +21,10 @@ async fn test_create_and_write() -> io::Result<()> {
// Write 10 bytes to the file.
file.write_all(b"some bytes").await?;
file.sync_all().await?; // tokio doesn't necessarily complete writes until you sync.
// For tokio's file I/O, `await` does not have its usual semantics of waiting until the
// operation is completed, so we have to wait some more to make sure the write is completed.
file.flush().await?;
// Check that 10 bytes have been written.
assert_eq!(file.metadata().await.unwrap().len(), 10);
remove_file(&path).unwrap();