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: port domains regression test from v0.10 #3356

Conversation

misterdjules
Copy link

f2a45ca contained a test for a
regression that had been introduced by the original change that
77a10ed ported. While
77a10ed did not contain that
regression, the test that f2a45ca
contained should still be in the code base to prevent any regression
from happening in the future.

Original message for the commit that contained the test:

domains: fix stack clearing after error handled

caeb677 introduced a regression where
the domains stack would not be cleared after an error had been handled
by the top-level domain.

This change clears the domains stack regardless of the position of the
active domain in the stack.

PR: #9364
PR-URL: nodejs/node-v0.x-archive#9364
Reviewed-By: Trevor Norris [email protected]
Reviewed-By: Julien Gilli [email protected]

@misterdjules misterdjules added domain Issues and PRs related to the domain subsystem. test Issues and PRs related to the tests. labels Oct 14, 2015
@misterdjules
Copy link
Author

/cc @nodejs/collaborators

@jbergstroem
Copy link
Member

CI: https://ci.nodejs.org/job/node-test-commit/832/

lint issue:

test/parallel/test-domain-top-level-error-handler-clears-stack.js
  1:0  error  Mandatory module "common" must be loaded  required-modules

@@ -0,0 +1,32 @@
'use strict';

Copy link
Contributor

Choose a reason for hiding this comment

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

include common

Copy link
Author

Choose a reason for hiding this comment

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

Thank you, updated.

@misterdjules
Copy link
Author

@jbergstroem @thefourtheye Thanks for catching the lint issue, and my apologies for not running make test in the first place.

@jbergstroem
Copy link
Member

Heading into cosmetics here, but could we perhaps use the shortform git commit sha's instead? Github automatically formats to this which makes the commit message look a bit weird unless read through -HTML.

// handled the original error, thus throwing here would trigger another
// call to process._fatalException, and so on recursively and
// indefinitely.
process.exit(1);
Copy link
Member

Choose a reason for hiding this comment

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

Maybe use process.abort() instead?

Copy link
Author

Choose a reason for hiding this comment

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

What is the advantage of using process.abort over process.exit in this case? One disadvantage I can think of is that it could create core files on some systems depending on their configuration.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that's a disadvantage. The advantage is that it's a lot more noisy than process.exit(1) is.

Copy link
Contributor

Choose a reason for hiding this comment

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

It will make this test take quite a bit longer on OS X at least too

Copy link
Author

Choose a reason for hiding this comment

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

Agreed. What about adding a noisy console.error output?

Copy link
Author

Choose a reason for hiding this comment

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

Updated this PR and added a console.error output before exiting, let me know what you think.

@bnoordhuis
Copy link
Member

LGTM with two suggestions.

@misterdjules
Copy link
Author

@jbergstroem @bnoordhuis Thanks for the review, will update shortly.

@jbergstroem Regarding using full commits shas: I always use full shas when I want to make sure that they can be found a long time after the commit message was written. It's difficult to determine how long git commit shas should be to never be ambiguous throughout the lifetime of the project. So instead of relying on guessing, I always include the full sha and I'm confident that anyone will be able to use them and unambiguously retrieve their corresponding changes.

@misterdjules
Copy link
Author

@jbergstroem @bnoordhuis Updated, please take a look.

'use strict';

const domain = require('domain');
const common = require('../common');
Copy link
Member

Choose a reason for hiding this comment

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

common should be the first import.

Copy link
Author

Choose a reason for hiding this comment

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

Right, updated, thank you.

f2a45ca contained a test for a
regression that had been introduced by the original change that
77a10ed ported. While
77a10ed did not contain that
regression, the test that f2a45ca
contained should still be in the code base to prevent any regression
from happening in the future.

Original message for the commit that contained the test:

  domains: fix stack clearing after error handled

  caeb677 introduced a regression where
  the domains stack would not be cleared after an error had been handled
  by the top-level domain.

  This change clears the domains stack regardless of the position of the
  active domain in the stack.

  PR: nodejs#9364
  PR-URL: nodejs/node-v0.x-archive#9364
  Reviewed-By: Trevor Norris <[email protected]>
  Reviewed-By: Julien Gilli <[email protected]>
@misterdjules
Copy link
Author

@jbergstroem @bnoordhuis ping. Let me know if my latest comments and updates address your concerns.

@misterdjules
Copy link
Author

misterdjules pushed a commit that referenced this pull request Oct 16, 2015
f2a45ca contained a test for a
regression that had been introduced by the original change that
77a10ed ported. While
77a10ed did not contain that
regression, the test that f2a45ca
contained should still be in the code base to prevent any regression
from happening in the future.

Original message for the commit that contained the test:

  domains: fix stack clearing after error handled

  caeb677 introduced a regression where
  the domains stack would not be cleared after an error had been handled
  by the top-level domain.

  This change clears the domains stack regardless of the position of the
  active domain in the stack.

  PR: #9364
  PR-URL: nodejs/node-v0.x-archive#9364
  Reviewed-By: Trevor Norris <[email protected]>
  Reviewed-By: Julien Gilli <[email protected]>

PR: #3356
PR-URL: #3356
Reviewed-By: Ben Noordhuis <[email protected]>
@misterdjules
Copy link
Author

Thank you, landed in 642928b.

@MylesBorins
Copy link
Contributor

@jasnell will tests like this make their ways into LTS?

@misterdjules
Copy link
Author

@thealphanerd That's a good question. My opinion is that yes, they should because they can only help make LTS releases more solid. Hence tagging this PR with land-on-v4.x.

rvagg pushed a commit that referenced this pull request Oct 19, 2015
f2a45ca contained a test for a
regression that had been introduced by the original change that
77a10ed ported. While
77a10ed did not contain that
regression, the test that f2a45ca
contained should still be in the code base to prevent any regression
from happening in the future.

Original message for the commit that contained the test:

  domains: fix stack clearing after error handled

  caeb677 introduced a regression where
  the domains stack would not be cleared after an error had been handled
  by the top-level domain.

  This change clears the domains stack regardless of the position of the
  active domain in the stack.

  PR: #9364
  PR-URL: nodejs/node-v0.x-archive#9364
  Reviewed-By: Trevor Norris <[email protected]>
  Reviewed-By: Julien Gilli <[email protected]>

PR: #3356
PR-URL: #3356
Reviewed-By: Ben Noordhuis <[email protected]>
@rvagg rvagg mentioned this pull request Oct 21, 2015
jasnell pushed a commit that referenced this pull request Oct 28, 2015
f2a45ca contained a test for a
regression that had been introduced by the original change that
77a10ed ported. While
77a10ed did not contain that
regression, the test that f2a45ca
contained should still be in the code base to prevent any regression
from happening in the future.

Original message for the commit that contained the test:

  domains: fix stack clearing after error handled

  caeb677 introduced a regression where
  the domains stack would not be cleared after an error had been handled
  by the top-level domain.

  This change clears the domains stack regardless of the position of the
  active domain in the stack.

  PR: #9364
  PR-URL: nodejs/node-v0.x-archive#9364
  Reviewed-By: Trevor Norris <[email protected]>
  Reviewed-By: Julien Gilli <[email protected]>

PR: #3356
PR-URL: #3356
Reviewed-By: Ben Noordhuis <[email protected]>
@jasnell
Copy link
Member

jasnell commented Oct 28, 2015

Landed in v4.x-staging in b8869bd

jasnell pushed a commit that referenced this pull request Oct 29, 2015
f2a45ca contained a test for a
regression that had been introduced by the original change that
77a10ed ported. While
77a10ed did not contain that
regression, the test that f2a45ca
contained should still be in the code base to prevent any regression
from happening in the future.

Original message for the commit that contained the test:

  domains: fix stack clearing after error handled

  caeb677 introduced a regression where
  the domains stack would not be cleared after an error had been handled
  by the top-level domain.

  This change clears the domains stack regardless of the position of the
  active domain in the stack.

  PR: #9364
  PR-URL: nodejs/node-v0.x-archive#9364
  Reviewed-By: Trevor Norris <[email protected]>
  Reviewed-By: Julien Gilli <[email protected]>

PR: #3356
PR-URL: #3356
Reviewed-By: Ben Noordhuis <[email protected]>
@misterdjules misterdjules deleted the port-domains-clears-stack-test branch July 24, 2017 17:36
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.

8 participants