Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: refactor test-fs-fsync #10176

Closed
wants to merge 1 commit into from
Closed

Conversation

radelmann
Copy link
Contributor

@radelmann radelmann commented Dec 8, 2016

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

Description of change
  • replace var with const.
  • remove successes variable.
  • use assert.ifError() for handling all errors.
  • wrap all callbacks with common.mustCall().

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Dec 8, 2016
@mscdex mscdex added the fs Issues and PRs related to the fs subsystem / file system. label Dec 8, 2016
Copy link
Member

@santigimeno santigimeno left a comment

Choose a reason for hiding this comment

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

LGTM with one question

fs.open(file, 'a', 0o777, function(err, fd) {
if (err) throw err;
const fdatasyncSync = common.mustCall(fs.fdatasyncSync);
const fsyncSync = common.mustCall(fs.fsyncSync);
Copy link
Member

Choose a reason for hiding this comment

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

Wrapping these in common.mustCall() is really necessary?

Copy link
Contributor Author

@radelmann radelmann Dec 8, 2016

Choose a reason for hiding this comment

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

@santigimeno Great question! I went back and forth with this before submitting. On one hand, I think having them makes the test a little more explicit and self documenting. On the other hand, they are not really needed since if either function fails, the test should throw an error. I am more than happy to remove them. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yea, on second though, these aren't needed. common.mustCall() isn't really necessary with any synchronous code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool, thanks for the input. I'll remove.

@santigimeno
Copy link
Member

- replace var with const.
- remove successes var.
- use assert.ifError() for handling all errors.
- wrap all callbacks with common.mustCall().
@radelmann
Copy link
Contributor Author

Bump

@italoacasas
Copy link
Contributor

Landed 34991be

Thanks for the contribution

italoacasas pushed a commit that referenced this pull request Dec 13, 2016
- replace var with const.
- remove successes var.
- use assert.ifError() for handling all errors.
- wrap all callbacks with common.mustCall().

PR-URL: #10176
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
AnnaMag pushed a commit to AnnaMag/node that referenced this pull request Dec 13, 2016
- replace var with const.
- remove successes var.
- use assert.ifError() for handling all errors.
- wrap all callbacks with common.mustCall().

PR-URL: nodejs#10176
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
evanlucas pushed a commit that referenced this pull request Dec 14, 2016
- replace var with const.
- remove successes var.
- use assert.ifError() for handling all errors.
- wrap all callbacks with common.mustCall().

PR-URL: #10176
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
@italoacasas italoacasas mentioned this pull request Dec 15, 2016
targos pushed a commit that referenced this pull request Dec 28, 2016
- replace var with const.
- remove successes var.
- use assert.ifError() for handling all errors.
- wrap all callbacks with common.mustCall().

PR-URL: #10176
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 22, 2017
- replace var with const.
- remove successes var.
- use assert.ifError() for handling all errors.
- wrap all callbacks with common.mustCall().

PR-URL: #10176
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 22, 2017
- replace var with const.
- remove successes var.
- use assert.ifError() for handling all errors.
- wrap all callbacks with common.mustCall().

PR-URL: #10176
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 24, 2017
- replace var with const.
- remove successes var.
- use assert.ifError() for handling all errors.
- wrap all callbacks with common.mustCall().

PR-URL: #10176
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 24, 2017
- replace var with const.
- remove successes var.
- use assert.ifError() for handling all errors.
- wrap all callbacks with common.mustCall().

PR-URL: #10176
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
This was referenced Jan 24, 2017
MylesBorins pushed a commit that referenced this pull request Jan 31, 2017
- replace var with const.
- remove successes var.
- use assert.ifError() for handling all errors.
- wrap all callbacks with common.mustCall().

PR-URL: #10176
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
MylesBorins pushed a commit that referenced this pull request Feb 1, 2017
- replace var with const.
- remove successes var.
- use assert.ifError() for handling all errors.
- wrap all callbacks with common.mustCall().

PR-URL: #10176
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fs Issues and PRs related to the fs subsystem / file system. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants