-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
doc,test: add server.timeout property to http2 public API #31693
doc,test: add server.timeout property to http2 public API #31693
Conversation
e89c317
to
6a97963
Compare
subsystem target in the commit message should just be |
changes: | ||
- version: v13.0.0 | ||
pr-url: https://github.com/nodejs/node/pull/27558 | ||
description: The default timeout changed from 120s to 0 (no timeout). |
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:
description: The default timeout changed from 120s to 0 (no timeout). | |
description: The default timeout changed from 120 seconds to 0 (no timeout). |
here and below
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.
The same text (120s
) is also used in http.md
and will be used in https.md
once #31692 lands. So, it's better to wait until that PR lands and change text in all places simultaneously.
@@ -6,14 +6,9 @@ if (!common.hasCrypto) | |||
const http2 = require('http2'); | |||
|
|||
const server = http2.createServer(); | |||
server.setTimeout(common.platformTimeout(50)); |
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.
Shouldn't we keep this as a separate test in this file since server.setTimeout()
should still work?
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.
At first I've moved it into a separate test, but I agree that it doesn't make a lot of sense in this case. Introduced additional assert in this very test.
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.
I think what was meant was a separate test file. Calling server.setTimeout()
then immediately resetting it with server.timeout
does not really ensure that server.setTimeout()
does the right thing.
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.
Original version of this PR included a separate test, but I have removed it and merged everything into a this test after receiving this comment.
@mscdex could you check current code and tell me if that's what you wanted?
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.
@mscdex could you check current code and tell me if that's what you wanted? I'm thinking of reverting this change, as it seems more logical to me to keep tests isolated.
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.
I have updated the test, so now it verifies both timeout
property and setTimeout
method in isolation from each other. Hopefully, it resolves this comment.
6a97963
to
c14907a
Compare
Done. |
c14907a
to
661fd6b
Compare
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 whoever lands this: It would be nice to have http2 mentioned in the commit message title
661fd6b
to
06f199e
Compare
Both http and https modules have server.timeout property in public API. This commit adds documentation section and test for server.timeout in http2 module, so it becomes consistent with http and https. Also improves description of callback argument in documentation for server.setTimeout().
06f199e
to
563c0ab
Compare
Landed in 51e8f28 |
Both http and https modules have server.timeout property in public API. This commit adds documentation section and test for server.timeout in http2 module, so it becomes consistent with http and https. Also improves description of callback argument in documentation for server.setTimeout(). PR-URL: #31693 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Both http and https modules have server.timeout property in public API. This commit adds documentation section and test for server.timeout in http2 module, so it becomes consistent with http and https. Also improves description of callback argument in documentation for server.setTimeout(). PR-URL: #31693 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Both
http
andhttps
modules haveserver.timeout
property in public API, whilehttp2
only hasserver.setTimeout
method documented. This PR adds documentation section and testfor
server.timeout
inhttp2
module, so it becomes consistent withhttp
andhttps
.Also improves description of
callback
argument in documentation forserver.setTimeout()
.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes