Skip to content

Commit c10a629

Browse files
authored
Merge pull request #4370 from Noratrieb/fix-for-real
Make sure to sync on file-io.rs tokio test
2 parents 4b94f67 + 0884c68 commit c10a629

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/tools/miri/tests/pass-dep/tokio/file-io.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ async fn test_create_and_write() -> io::Result<()> {
2121

2222
// Write 10 bytes to the file.
2323
file.write_all(b"some bytes").await?;
24+
// For tokio's file I/O, `await` does not have its usual semantics of waiting until the
25+
// operation is completed, so we have to wait some more to make sure the write is completed.
26+
file.flush().await?;
27+
// Check that 10 bytes have been written.
2428
assert_eq!(file.metadata().await.unwrap().len(), 10);
2529

2630
remove_file(&path).unwrap();

0 commit comments

Comments
 (0)