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

tests: introduce runWithInvalidFD to trigger EBADF reliably #18864

Closed
wants to merge 2 commits into from

Conversation

joyeecheung
Copy link
Member

Fixes: #18820

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

test

This provides a more reliable way to get a fd that can be used
to tirgger EBADF.
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Feb 19, 2018
@joyeecheung
Copy link
Member Author

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

LGTM. Just wandering if it would not be nicer if the function would just return a invalid fd.

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 21, 2018
@joyeecheung
Copy link
Member Author

@BridgeAR I've tried that before and ended up with a bunch of if (fd === -1) { ... } else { common.printSkipMessage(...) } which I don't think is necessary to duplicate.

@joyeecheung
Copy link
Member Author

joyeecheung commented Feb 22, 2018

Landed in 13637d2...5055c29, thanks!

joyeecheung added a commit that referenced this pull request Feb 22, 2018
This provides a more reliable way to get a fd that can be used
to tirgger EBADF.

PR-URL: #18864
Fixes: #18820
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
joyeecheung added a commit that referenced this pull request Feb 22, 2018
PR-URL: #18864
Fixes: #18820
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@joyeecheung joyeecheung removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 22, 2018
@MylesBorins
Copy link
Contributor

Should this be backported to v9.x-staging? If yes please follow the guide and raise a backport PR, if not let me know or add the dont-land-on label.

@joyeecheung
Copy link
Member Author

Adding don't land labels since it is changing tests for semver-major changes

MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
This provides a more reliable way to get a fd that can be used
to tirgger EBADF.

PR-URL: nodejs#18864
Fixes: nodejs#18820
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
PR-URL: nodejs#18864
Fixes: nodejs#18820
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants