-
Notifications
You must be signed in to change notification settings - Fork 30k
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 assert.throws error in test-http-parser #19626
Conversation
The third argument of `assert.throws()` is a message that is used by the AssertionError, not the message to check in the thrown error. It appears that there is an assert.throws() in test-http-parser that expects the latter behavior. Rewrite the call to check the error message. Even if this wasn't a mistake, this change results in a more robust check.
Failure on CI appears to be the "mysterious crash with no stack trace" we've been seeing from time to time. @BridgeAR https://ci.nodejs.org/job/node-test-commit-linux/17375/nodes=debian8-x86/console 00:33:11 not ok 924 parallel/test-http2-compat-socket
00:33:11 ---
00:33:11 duration_ms: 0.508
00:33:11 severity: fail
00:33:11 stack: |-
00:33:11 (node:15382) ExperimentalWarning: The http2 module is an experimental API.
00:33:11 ... In any event, should be unrelated to this PR. Re-running node-test-commit-linux: https://ci.nodejs.org/job/node-test-commit-linux/17376/ |
@Trott thanks for pointing that out. I am going to try to get back to that problem again. |
(CI re-run was green.) |
The third argument of `assert.throws()` is a message that is used by the AssertionError, not the message to check in the thrown error. It appears that there is an assert.throws() in test-http-parser that expects the latter behavior. Rewrite the call to check the error message. Even if this wasn't a mistake, this change results in a more robust check. PR-URL: nodejs#19626 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in 42d1d72 |
The third argument of `assert.throws()` is a message that is used by the AssertionError, not the message to check in the thrown error. It appears that there is an assert.throws() in test-http-parser that expects the latter behavior. Rewrite the call to check the error message. Even if this wasn't a mistake, this change results in a more robust check. PR-URL: #19626 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
The third argument of
assert.throws()
is a message that is used by theAssertionError, not the message to check in the thrown error. It appears
that there is an assert.throws() in test-http-parser that expects the
latter behavior. Rewrite the call to check the error message. Even if
this wasn't a mistake, this change results in a more robust check.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes