Skip to content

test: add fs/promises filehandle sync() and datasync() tests. - #20530

Closed
shisama wants to merge 4 commits into
nodejs:masterfrom
shisama:test-fs-promises-file-handle-sync
Closed

test: add fs/promises filehandle sync() and datasync() tests.#20530
shisama wants to merge 4 commits into
nodejs:masterfrom
shisama:test-fs-promises-file-handle-sync

Conversation

@shisama

Copy link
Copy Markdown
Contributor

To increase test coverage for fs/promises,
added tests for filehandle.sync and filehandle.datasync.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-botnodejs-github-bot added the test Issues and PRs related to the tests. label May 5, 2018

@ChALkeRChALkeRMay 6, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handle.write(buf)?
Same results and coverage, also see #20559.

@ChALkeRChALkeRMay 6, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

read(handlehandle.read(? See the comment above.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChALkeR Fixed them. Thanks.

@ChALkeRChALkeR added experimental Issues and PRs related to experimental features. fs Issues and PRs related to the fs subsystem / file system. labels May 8, 2018
@shisama
shisamaforce-pushed the test-fs-promises-file-handle-sync branch from 1ff5b56 to e8f8408CompareMay 9, 2018 01:50
@ChALkeR

Copy link
Copy Markdown
Member

/cc @Trott

@BridgeAR

Copy link
Copy Markdown
Member

@shisama
shisamaforce-pushed the test-fs-promises-file-handle-sync branch from 5784c2d to 2b54d4aCompareJune 5, 2018 11:27
@shisama

Copy link
Copy Markdown
ContributorAuthor

This is rebased on 0300f7c. make -j4 test is passed.

@apapirovski

Copy link
Copy Markdown
Contributor

@nodejs/fs please give this a look and a review, if possible. It's been over a month.

@joyeecheungjoyeecheung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem to actually test that fsync and fdatasync calls are effective, but I am not quite sure how to write tests for them with our APIs either, so LGTM as long as the code paths are covered.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

common.mustCall() here seems unnecessary. If anything, common.crashOnUnhandledRejection() above gives a better hint about why it fails.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joyeecheung Thanks. Removed common.mustCall().

Masashi Hirano added 4 commits June 10, 2018 16:37
To increase test coverage for fs/promises,
added tests for filehandle.sync and filehandle.datasync.
Replacing fs/promises methods read and write with fs/promises
filehandle methods.
Fix module loading because fs/promises was moved to fs.promises
@shisama
shisamaforce-pushed the test-fs-promises-file-handle-sync branch from 2b54d4a to d462d2cCompareJune 10, 2018 08:50
@apapirovski

Copy link
Copy Markdown
Contributor

@apapirovskiapapirovski added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 25, 2018
@shisama

Copy link
Copy Markdown
ContributorAuthor

CI failure is not related to this. It happens in parallel/test-timers-same-timeout-wrong-list-deleted.

@hiroppy

Copy link
Copy Markdown
Member

CI: https://ci.nodejs.org/job/node-test-pull-request/15690/

@shisama

Copy link
Copy Markdown
ContributorAuthor

I think CI failure node-test-commit-windows-fanned is not related to this.

@targos

Copy link
Copy Markdown
Member

targos pushed a commit to targos/node that referenced this pull request Jul 15, 2018
To increase test coverage for fs.promises,
added tests for filehandle.sync and filehandle.datasync.
PR-URL: nodejs#20530
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@targos

Copy link
Copy Markdown
Member

Landed in 71ca076. Thanks for the contribution @shisama.

@targostargos closed this Jul 15, 2018
@targostargos removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 15, 2018
targos pushed a commit that referenced this pull request Jul 15, 2018
To increase test coverage for fs.promises,
added tests for filehandle.sync and filehandle.datasync.
PR-URL: #20530
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

experimentalIssues and PRs related to experimental features.fsIssues and PRs related to the fs subsystem / file system.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

@shisama@ChALkeR@BridgeAR@apapirovski@hiroppy@targos@jasnell@cjihrig@joyeecheung@nodejs-github-bot