We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b88cbed commit 0884c68Copy full SHA for 0884c68
src/tools/miri/tests/pass-dep/tokio/file-io.rs
@@ -21,7 +21,10 @@ async fn test_create_and_write() -> io::Result<()> {
21
22
// Write 10 bytes to the file.
23
file.write_all(b"some bytes").await?;
24
- 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
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.
28
assert_eq!(file.metadata().await.unwrap().len(), 10);
29
30
remove_file(&path).unwrap();
0 commit comments