-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: add test-domain-exit-dispose-again back #4256
test: add test-domain-exit-dispose-again back #4256
Conversation
1c85849 "fixed" test-domain-exit-dispose-again by changing its logic to test that process.domain was cleared properly in case an error was thrown from a timer's callback. However, it became clear when reviewing a recent change that refactors lib/timers.js that it was not quite the intention of the original test. Thus, this change adds the original implementation of test-domain-exit-dispose-again back, with comments that make its implementation easier to understand. It also preserve the changes made by 1c85849, but it moves them to a new test file named test-timers-reset-process-domain-on-throw.js.
CI tests running. |
Tests seem fine, I'll test it on the PR with and without the related code when I get the chance. |
Note: my timers branch does not have 1c85849, and the old version doesn't catch the relevant change in timers. |
if (process.domain !== null) { | ||
console.log('process.domain should be null, but instead is:', | ||
process.domain); | ||
process.exit(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually we avoid using process.exit()
in tests because it is rather immediate, is there a way this could be switched to Throw?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is explained by the comment above:
// Do not use assert here, as it throws errors and if a domain with an error
// handler is active, then asserting wouldn't make the test fail.
maybe this comment should be moved right above the call to process.exit(1)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, probably. And of course, domains, oopsie.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, I'll move it closer to the call to process.exit
.
@Fishrock123 Just to make sure we're on the same page: do you mean that the version of |
/ping @Fishrock123 Did you have some time to look at my answers to your questions/comments? |
@Fishrock123 Pushed a new commit that I believe addresses your review comments. If that looks good to you, I'll squash the two commits in one. Thanks! |
I don't understand the details, but ok! Rubber-stamp LGTM as I don't feel like I can adequately assess the tests' details, but since this is just re-introducing an old test it should be fine. CI again, for good measure: https://ci.nodejs.org/job/node-test-pull-request/1144/ |
1c85849 "fixed" test-domain-exit-dispose-again by changing its logic to test that process.domain was cleared properly in case an error was thrown from a timer's callback. However, it became clear when reviewing a recent change that refactors lib/timers.js that it was not quite the intention of the original test. Thus, this change adds the original implementation of test-domain-exit-dispose-again back, with comments that make its implementation easier to understand. It also preserve the changes made by 1c85849, but it moves them to a new test file named test-timers-reset-process-domain-on-throw.js. PR: #4256 PR-URL: #4256 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Thank you @Fishrock123. Landed in 1453b87. |
1c85849 "fixed" test-domain-exit-dispose-again by changing its logic to test that process.domain was cleared properly in case an error was thrown from a timer's callback. However, it became clear when reviewing a recent change that refactors lib/timers.js that it was not quite the intention of the original test. Thus, this change adds the original implementation of test-domain-exit-dispose-again back, with comments that make its implementation easier to understand. It also preserve the changes made by 1c85849, but it moves them to a new test file named test-timers-reset-process-domain-on-throw.js. PR: nodejs#4256 PR-URL: nodejs#4256 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
1c85849 "fixed" test-domain-exit-dispose-again by changing its logic to test that process.domain was cleared properly in case an error was thrown from a timer's callback. However, it became clear when reviewing a recent change that refactors lib/timers.js that it was not quite the intention of the original test. Thus, this change adds the original implementation of test-domain-exit-dispose-again back, with comments that make its implementation easier to understand. It also preserve the changes made by 1c85849, but it moves them to a new test file named test-timers-reset-process-domain-on-throw.js. PR: #4256 PR-URL: #4256 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
1c85849 "fixed" test-domain-exit-dispose-again by changing its logic to test that process.domain was cleared properly in case an error was thrown from a timer's callback. However, it became clear when reviewing a recent change that refactors lib/timers.js that it was not quite the intention of the original test. Thus, this change adds the original implementation of test-domain-exit-dispose-again back, with comments that make its implementation easier to understand. It also preserve the changes made by 1c85849, but it moves them to a new test file named test-timers-reset-process-domain-on-throw.js. PR: #4256 PR-URL: #4256 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
1c85849 "fixed" test-domain-exit-dispose-again by changing its logic to test that process.domain was cleared properly in case an error was thrown from a timer's callback. However, it became clear when reviewing a recent change that refactors lib/timers.js that it was not quite the intention of the original test. Thus, this change adds the original implementation of test-domain-exit-dispose-again back, with comments that make its implementation easier to understand. It also preserve the changes made by 1c85849, but it moves them to a new test file named test-timers-reset-process-domain-on-throw.js. PR: nodejs#4256 PR-URL: nodejs#4256 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Rename the test appropriately alongside mentioning the subsystem Also, make a few basic changes to make sure the test conforms to the standard test structure Refs: nodejs#19105 Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure
Rename the tests appropriately alongside mentioning the subsystem. Also, make a few basic changes to make sure the test conforms to the standard test structure. This renames: - test-regress-nodejsGH-1531 - test-regress-nodejsGH-2245 - test-regress-nodejsGH-3238 - test-regress-nodejsGH-3542 - test-regress-nodejsGH-3739 - test-regress-nodejsGH-4256 PR-URL: nodejs#19212 Refs: nodejs#19105 Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Rename the tests appropriately alongside mentioning the subsystem. Also, make a few basic changes to make sure the test conforms to the standard test structure. This renames: - test-regress-GH-1531 - test-regress-GH-2245 - test-regress-GH-3238 - test-regress-GH-3542 - test-regress-GH-3739 - test-regress-GH-4256 PR-URL: #19212 Refs: #19105 Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Rename the tests appropriately alongside mentioning the subsystem. Also, make a few basic changes to make sure the test conforms to the standard test structure. This renames: - test-regress-GH-1531 - test-regress-GH-2245 - test-regress-GH-3238 - test-regress-GH-3542 - test-regress-GH-3739 - test-regress-GH-4256 PR-URL: #19212 Refs: #19105 Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Rename the tests appropriately alongside mentioning the subsystem. Also, make a few basic changes to make sure the test conforms to the standard test structure. This renames: - test-regress-nodejsGH-1531 - test-regress-nodejsGH-2245 - test-regress-nodejsGH-3238 - test-regress-nodejsGH-3542 - test-regress-nodejsGH-3739 - test-regress-nodejsGH-4256 PR-URL: nodejs#19212 Refs: nodejs#19105 Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Rename the tests appropriately alongside mentioning the subsystem. Also, make a few basic changes to make sure the test conforms to the standard test structure. This renames: - test-regress-GH-1531 - test-regress-GH-2245 - test-regress-GH-3238 - test-regress-GH-3542 - test-regress-GH-3739 - test-regress-GH-4256 PR-URL: #19212 Refs: #19105 Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
1c85849 "fixed"
test-domain-exit-dispose-again by changing its logic to test that
process.domain was cleared properly in case an error was thrown from a
timer's callback.
However, it became clear when reviewing a recent change that refactors
lib/timers.js that it was not quite the intention of the original test.
Thus, this change adds the original implementation of
test-domain-exit-dispose-again back, with comments that make its
implementation easier to understand.
It also preserve the changes made by
1c85849, but it moves them to a new
test file named test-timers-reset-process-domain-on-throw.js.
/cc @Fishrock123 This is the test I mentioned in #4007 (comment).