test-fs-promises-write-optional-params does't check read bytes counts Β #46144
Copy link
Copy link
Closed
Labels
flaky-testIssues and PRs involving tests that fail intermittently in CI.Issues and PRs involving tests that fail intermittently in CI.fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.
Description
Activity
- addedflaky-testIssues and PRs involving tests that fail intermittently in CI.Issues and PRs involving tests that fail intermittently in CI.
on Jan 9, 2023 - addedlinuxIssues and PRs related to the Linux platform.Issues and PRs related to the Linux platform.
on Jan 9, 2023 The same test behavior is for
test-fs-write-optional-params- addedfsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.and removedlinuxIssues and PRs related to the Linux platform.Issues and PRs related to the Linux platform.
on Jan 17, 2023 Thanks for catching this! The same also applies to
test-fs-write-sync-optional-params.- This part of test checks compatibility with
readcounterparts and for some combinations (e.g.{ length: null }) we can't get equalbytesWrittenandbytesRead, hence the "greater or equal" assertion. Assertion when there is an explicitlengthis indeed missing. - There is an issue in these tests: when
position == null, subsequent read starts from current file position rather than from beginning.
Both errors should be fixed by linked PR, but suggestions or alternative PR are always welcome.
- This part of test checks compatibility with
- added a commit that references this issue
on Jan 19, 2023 - added a commit that references this issue
on Jan 20, 2023 - added 2 commits that reference this issue
on Mar 3, 2023
Metadata
Metadata
Assignees
Labels
flaky-testIssues and PRs involving tests that fail intermittently in CI.Issues and PRs involving tests that fail intermittently in CI.fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.
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 intestValid()functions are OK, because 2 errors:assert.ok(writeResult.bytesWritten >= readResult.bytesRead);is ok because 3>0assert.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.