test: make crashOnUnhandleRejection opt-out#21849
Closed
targos wants to merge 2 commits intonodejs:masterfrom
Closed
test: make crashOnUnhandleRejection opt-out#21849targos wants to merge 2 commits intonodejs:masterfrom
targos wants to merge 2 commits intonodejs:masterfrom
Conversation
tniessen
approved these changes
Jul 17, 2018
cjihrig
approved these changes
Jul 17, 2018
addaleax
approved these changes
Jul 17, 2018
Member
Author
test/common/README.md
Outdated
Contributor
There was a problem hiding this comment.
Should be placed after the ddCommand() now)
devsnek
approved these changes
Jul 17, 2018
jasnell
approved these changes
Jul 17, 2018
trivikr
approved these changes
Jul 18, 2018
This commit removes `common.crashOnUnhandledRejection()` and adds `common.disableCrashOnUnhandledRejection()`. To reduce the risk of mistakes and make writing tests that involve promises simpler, always install the unhandledRejection hook in tests and provide a way to disable it for there rare cases where it's needed.
49d1b4b to
a94af81
Compare
Member
Author
|
Landed in df08779 |
targos
added a commit
that referenced
this pull request
Jul 19, 2018
This commit removes `common.crashOnUnhandledRejection()` and adds `common.disableCrashOnUnhandledRejection()`. To reduce the risk of mistakes and make writing tests that involve promises simpler, always install the unhandledRejection hook in tests and provide a way to disable it for the rare cases where it's needed. PR-URL: #21849 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Member
Author
|
Depends on #20830 to land on |
richardlau
reviewed
Jul 23, 2018
| process.on('unhandledRejection', | ||
| (err) => process.nextTick(() => { throw err; })); | ||
| const crashOnUnhandledRejection = (err) => { throw err; }; | ||
| process.on('unhandledRejection', crashOnUnhandledRejection); |
Member
There was a problem hiding this comment.
Was it intentional to drop the process.nextTick()?
Member
Author
There was a problem hiding this comment.
It was not. Do you think we should put it back?
Member
There was a problem hiding this comment.
Not sure -- I was confused because the README says:
Removes the
process.on('unhandledRejection')handler that crashes the process
after a tick.
so I assumed the process.nextTick() in the original code was intentional. ¯\_(ツ)_/¯
Member
Author
Member
There was a problem hiding this comment.
@targos I don’t remember – I’d assume dropping it is okay.
targos
added a commit
that referenced
this pull request
Jul 24, 2018
This commit removes `common.crashOnUnhandledRejection()` and adds `common.disableCrashOnUnhandledRejection()`. To reduce the risk of mistakes and make writing tests that involve promises simpler, always install the unhandledRejection hook in tests and provide a way to disable it for the rare cases where it's needed. PR-URL: #21849 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit removes
common.crashOnUnhandledRejection()and addscommon.disableCrashOnUnhandledRejection().To reduce the risk of mistakes and make writing tests that involve
promises simpler, always install the unhandledRejection hook in tests
and provide a way to disable it for there rare cases where it's needed.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes