about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2025-06-01 16:27:27 +0200
committerRalf Jung <post@ralfj.de>2025-06-01 16:32:18 +0200
commit0884c683ad3fef0b8c02ed7fdf7aa3ee874a7e3d (patch)
tree4660bb76e609a3da0d9cd6f05caa2c335b8d3c56
parentb88cbed741c7de3371e627004ba8fde62578c176 (diff)
downloadrust-0884c683ad3fef0b8c02ed7fdf7aa3ee874a7e3d.tar.gz
rust-0884c683ad3fef0b8c02ed7fdf7aa3ee874a7e3d.zip
tweak comment and use a weaker fence
-rw-r--r--src/tools/miri/tests/pass-dep/tokio/file-io.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tools/miri/tests/pass-dep/tokio/file-io.rs b/src/tools/miri/tests/pass-dep/tokio/file-io.rs
index 7d05260c955..067753203bb 100644
--- a/src/tools/miri/tests/pass-dep/tokio/file-io.rs
+++ b/src/tools/miri/tests/pass-dep/tokio/file-io.rs
@@ -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();