Skip to content

test-fs-promises-write-optional-params does't check read bytes counts  #46144

Closed
@dmitry-chukanov

Description

@dmitry-chukanov

Test

test-fs-promises-write-optional-params

Platform

Linux x64

Console output

No response

Build links

Additional information

There are several options in test-fs-promises-write-optional-params (at the file end) such as 'undefined', 'null', '{}' and so on. And for '{}' option we read 0 bytes in testValid() function and read buffer hasn't any changes after read. But all asserts in testValid() functions are OK, because 2 errors:

  1. No any assert for really read bytes (may be 0 or any other positive value). In the test string assert.ok(writeResult.bytesWritten >= readResult.bytesRead); is ok because 3>0
  2. Only one buffer without any resets after write is used for write/read operations. This buffer doesn't have any changes after read if 0 bytes was read and there are the same values that before write. So assert.deepStrictEqual(writeResult.buffer, readResult.buffer);is also ok, because both buffers are the same and because read doesn't make any changes in buffer if 0 bytes was read.

Metadata

Metadata

Assignees

No one assigned

    Labels

    flaky-testIssues and PRs related to the tests with unstable failures on the CI.fsIssues and PRs related to the fs subsystem / file system.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions