-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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: test async-hook triggerId invariant #13328
Conversation
process.nextTick(() => { | ||
process.nextTick(() => { | ||
triggerId1 = triggerId(); | ||
assert.notEqual(triggerId0, triggerId1, "Async resources having different causal ancestry should have different triggerIds") |
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.
long line here. please line break at <= 80 chars and run make lint
:-)
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.
Also, this should likely use assert.notStrictEqual()
}) | ||
process.nextTick(() => { | ||
const triggerId2 = triggerId(); | ||
assert.equal(triggerId1, triggerId2, |
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.
assert.strictEqual()
here
Mind adding a comment in the commit message body about what important scenario/etc. this is testing for? |
Add tests for checking the behavior of async_hooks.triggerId. It should return different ids when called in callbacks having different ancestry paths. It should return the same id when called in callbacks having the same ancestry path.
updated! |
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.
Thanks for editing the commit message.
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.
LGTM, Thanks.
Landed in fcab69c, thank you for the PR! |
Add tests for checking the behavior of async_hooks.triggerId. It should return different ids when called in callbacks having different ancestry paths. It should return the same id when called in callbacks having the same ancestry path. PR-URL: #13328 Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: Andreas Madsen <[email protected]> Reviewed-By: Andreas Madsen <[email protected]>
Add tests for checking the behavior of async_hooks.triggerId. It should return different ids when called in callbacks having different ancestry paths. It should return the same id when called in callbacks having the same ancestry path. PR-URL: #13328 Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: Andreas Madsen <[email protected]>
Add tests for checking the behavior of async_hooks.triggerId. It should return different ids when called in callbacks having different ancestry paths. It should return the same id when called in callbacks having the same ancestry path. PR-URL: #13328 Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: Andreas Madsen <[email protected]>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test
Adds two tests to check that the
triggerId
invariant is satisfied, that is async resources with the same cause have the sametriggerId
, while those with different cause have differenttriggerId
s.