mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 20:46:07 +03:00
tweak comment and use a weaker fence
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user