-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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: Http2Stream destroy server before shutdown #15597
Conversation
'use strict'; | ||
|
||
const common = require('../common'); | ||
if (!common.hasCrypto) common.skip('missing crypto'); |
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.
Nit: can you please put the body on the next line? I think it is the dominant style throughout the code base.
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.
Done!
() => stream.session.shutdown(), | ||
common.expectsError({ | ||
code: 'ERR_HTTP2_INVALID_SESSION', | ||
message: /^The session has been destroyed$/ |
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.
This probably doesn't need to be a RegExp.
Also, for future reference, common.expectsError
can take () => stream.session.shutdown()
as the first argument and the error object as the 2nd. (No need for assert.throws
.)
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.
For example:
common.expectsError(
() => stream.session.shutdown(),
{
code: 'ERR_HTTP2_INVALID_SESSION',
type: Error,
message: 'The session has been destroyed'
}
);
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.
Done!
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 with the suggested change to use common.expectsError
When the commits in this PR are squashed before merge, the commit message must be:
|
@trivikr if you want you can squash now, force push and save us some work :) |
16810b8
to
0cef487
Compare
@lpinca Done with squash and force push! |
Btw I think you need to update your git user.name and user.email
See https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#setting-up-your-local-environment Right now your commits don't seem to be associating properly. |
0cef487
to
e27cb36
Compare
Thanks @apapirovski |
e27cb36
to
48fa0d8
Compare
@BridgeAR rebase complete! |
285c729
to
48fa0d8
Compare
48fa0d8
to
45ffc5f
Compare
@BridgeAR I removed the merge commit and performed rebase as per the documentation |
Landed in 5dd6583 |
PR-URL: nodejs/node#15597 Refs: nodejs/node#14985 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This PR includes a test case for the handling of
stream.session.shutdown()
when session is already destroyed.This is my first PR in node, will add more tests for http2 after getting this reviewed/merged.
Refs: #14985
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test, http2