-
Notifications
You must be signed in to change notification settings - Fork 266
Closed
Labels
area: testinghelpersIssues that address the testing helpersIssues that address the testing helpersstate: ready to pickIssues that are ready for being worked onIssues that are ready for being worked onstate: releasedIssues that are releasedIssues that are releasedtype: bugIssues that describe misbehaving functionalityIssues that describe misbehaving functionality
Description
Describe the bug
While Flush does update the contents of the file, allowing other streams to read it later, FlushAsync does not.
To Reproduce
var fs = new MockFileSystem();
var file = fs.FileInfo.New("/file");
await using var first = file.OpenWrite();
await first.WriteAsync(new byte[] { 42 });
await first.FlushAsync();
await using var second = file.OpenRead();
var buffer = new byte[1];
Assert.Equal(1, await second.ReadAsync(buffer));
Assert.Equal(42, buffer[0]);Expected behavior
Behave identically to the synchronous version, which does successfully pass.
var fs = new MockFileSystem();
var file = fs.FileInfo.New("/file");
using var first = file.OpenWrite();
first.Write(new byte[] { 42 });
first.Flush();
using var second = file.OpenRead();
var buffer = new byte[1];
Assert.Equal(1, second.Read(buffer));
Assert.Equal(42, buffer[0]);Metadata
Metadata
Assignees
Labels
area: testinghelpersIssues that address the testing helpersIssues that address the testing helpersstate: ready to pickIssues that are ready for being worked onIssues that are ready for being worked onstate: releasedIssues that are releasedIssues that are releasedtype: bugIssues that describe misbehaving functionalityIssues that describe misbehaving functionality