Skip to content

FlushAsync doesn't update file contents #959

Description

@cryocz

Describe the bug
While Flush does update the contents of the file, allowing other streams to read it later, FlushAsync does not.

To Reproduce

varfs=newMockFileSystem();varfile=fs.FileInfo.New("/file");awaitusingvarfirst=file.OpenWrite();awaitfirst.WriteAsync(newbyte[]{42});awaitfirst.FlushAsync();awaitusingvarsecond=file.OpenRead();varbuffer=newbyte[1];Assert.Equal(1,awaitsecond.ReadAsync(buffer));Assert.Equal(42,buffer[0]);

Expected behavior
Behave identically to the synchronous version, which does successfully pass.

varfs=newMockFileSystem();varfile=fs.FileInfo.New("/file");usingvarfirst=file.OpenWrite();first.Write(newbyte[]{42});first.Flush();usingvarsecond=file.OpenRead();varbuffer=newbyte[1];Assert.Equal(1,second.Read(buffer));Assert.Equal(42,buffer[0]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: testinghelpersIssues that address the testing helpersstate: ready to pickIssues that are ready for being worked onstate: releasedIssues that are releasedtype: bugIssues that describe misbehaving functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions