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: fix test-domain-exit-dispose-again #3991

Conversation

misterdjules
Copy link

test-domain-exit-dispose-again had been written for node v0.10.x, and
was using the fact that callbacks scheduled with process.nextTick
wouldn't run if the domain attached to it was disposed.

This is not longer the case, and as a result the test would not catch
any regression: it would always pass.

This change rewrites that test to check that the current domain is
cleared properly when processing the rest of the timers list if a
timer's callback throws an error. This makes the test fail without the
original fix, and pass with the original fix, as expected.

test-domain-exit-dispose-again had been written for node v0.10.x, and
was using the fact that callbacks scheduled with `process.nextTick`
wouldn't run if the domain attached to it was disposed.

This is not longer the case, and as a result the test would not catch
any regression: it would always pass.

This change rewrites that test to check that the current domain is
cleared properly when processing the rest of the timers list if a
timer's callback throws an error. This makes the test fail without the
original fix, and pass with the original fix, as expected.
@misterdjules misterdjules added domain Issues and PRs related to the domain subsystem. test Issues and PRs related to the tests. lts-watch-v0.12 labels Nov 23, 2015
@misterdjules
Copy link
Author

This is a back port of #3990 from master to v0.12-staging.

/cc @nodejs/tsc @nodejs/collaborators

This was first found by @Fishrock123 when playing with timers. See the original discussion.

@trevnorris
Copy link
Contributor

LGTM

@misterdjules
Copy link
Author

@trevnorris Thank you for the review!

CI tests running.

@misterdjules
Copy link
Author

All tests pass, except for some tests on Windows (VS 2015 on Windows 10, VS 2013 on Windows 2008 and VS 2015 on Windows 2012) that are not related to the changes in this PR , so I will merge it asap.

misterdjules pushed a commit that referenced this pull request Nov 27, 2015
test-domain-exit-dispose-again had been written for node v0.10.x, and
was using the fact that callbacks scheduled with `process.nextTick`
wouldn't run if the domain attached to it was disposed.

This is not longer the case, and as a result the test would not catch
any regression: it would always pass.

This change rewrites that test to check that the current domain is
cleared properly when processing the rest of the timers list if a
timer's callback throws an error. This makes the test fail without the
original fix, and pass with the original fix, as expected.

PR: #3991
PR-URL: #3991
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
@misterdjules
Copy link
Author

Landed in 53ef1a7.

misterdjules pushed a commit that referenced this pull request Dec 4, 2015
test-domain-exit-dispose-again had been written for node v0.10.x, and
was using the fact that callbacks scheduled with `process.nextTick`
wouldn't run if the domain attached to it was disposed.

This is not longer the case, and as a result the test would not catch
any regression: it would always pass.

This change rewrites that test to check that the current domain is
cleared properly when processing the rest of the timers list if a
timer's callback throws an error. This makes the test fail without the
original fix, and pass with the original fix, as expected.

PR: #3991
PR-URL: #3991
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
MylesBorins pushed a commit that referenced this pull request Feb 11, 2016
test-domain-exit-dispose-again had been written for node v0.10.x, and
was using the fact that callbacks scheduled with `process.nextTick`
wouldn't run if the domain attached to it was disposed.

This is not longer the case, and as a result the test would not catch
any regression: it would always pass.

This change rewrites that test to check that the current domain is
cleared properly when processing the rest of the timers list if a
timer's callback throws an error. This makes the test fail without the
original fix, and pass with the original fix, as expected.

PR: #3991
PR-URL: #3991
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
jBarz pushed a commit to ibmruntimes/node that referenced this pull request Nov 4, 2016
test-domain-exit-dispose-again had been written for node v0.10.x, and
was using the fact that callbacks scheduled with `process.nextTick`
wouldn't run if the domain attached to it was disposed.

This is not longer the case, and as a result the test would not catch
any regression: it would always pass.

This change rewrites that test to check that the current domain is
cleared properly when processing the rest of the timers list if a
timer's callback throws an error. This makes the test fail without the
original fix, and pass with the original fix, as expected.

PR: nodejs#3991
PR-URL: nodejs/node#3991
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
@misterdjules misterdjules deleted the fix-test-domain-exit-dispose-again-v0.12 branch July 24, 2017 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain Issues and PRs related to the domain subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants