about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2025-06-01 14:58:14 +0000
committerGitHub <noreply@github.com>2025-06-01 14:58:14 +0000
commitc10a629224ff6eb6d697d8f2e6d9b2e45593fb20 (patch)
tree4660bb76e609a3da0d9cd6f05caa2c335b8d3c56
parent4b94f670de047b94753018935043e6eb82df0caf (diff)
parent0884c683ad3fef0b8c02ed7fdf7aa3ee874a7e3d (diff)
downloadrust-c10a629224ff6eb6d697d8f2e6d9b2e45593fb20.tar.gz
rust-c10a629224ff6eb6d697d8f2e6d9b2e45593fb20.zip
Merge pull request #4370 from Noratrieb/fix-for-real
Make sure to sync on file-io.rs tokio test
-rw-r--r--src/tools/miri/tests/pass-dep/tokio/file-io.rs4
1 files changed, 4 insertions, 0 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 e4e92349970..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,6 +21,10 @@ async fn test_create_and_write() -> io::Result<()> {
 
     // Write 10 bytes to the file.
     file.write_all(b"some bytes").await?;
+    // 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();