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

doc,test: add server.timeout property to http2 public API #31693

Closed

Conversation

puzpuzpuz
Copy link
Member

@puzpuzpuz puzpuzpuz commented Feb 8, 2020

Both http and https modules have server.timeout property in public API, while http2 only has server.setTimeout method documented. This PR 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().

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@puzpuzpuz puzpuzpuz force-pushed the doc/describe-http2-server-timeout branch from e89c317 to 6a97963 Compare February 8, 2020 11:55
@mscdex
Copy link
Contributor

mscdex commented Feb 8, 2020

subsystem target in the commit message should just be doc,test:

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).
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
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

Copy link
Member Author

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));
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member Author

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.

Copy link
Member Author

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.

@puzpuzpuz puzpuzpuz force-pushed the doc/describe-http2-server-timeout branch from 6a97963 to c14907a Compare February 8, 2020 14:45
@puzpuzpuz
Copy link
Member Author

subsystem target in the commit message should just be doc,test:

Done.

@puzpuzpuz puzpuzpuz force-pushed the doc/describe-http2-server-timeout branch from c14907a to 661fd6b Compare February 8, 2020 14:49
@mscdex mscdex changed the title http2,doc,test: add server.timeout property to public API doc,test: add server.timeout property to public API Feb 8, 2020
@addaleax addaleax added the http2 Issues or PRs related to the http2 subsystem. label Feb 13, 2020
Copy link
Member

@addaleax addaleax left a 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

@addaleax addaleax added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. doc Issues and PRs related to the documentations. test Issues and PRs related to the tests. labels Feb 13, 2020
@nodejs-github-bot
Copy link
Collaborator

@puzpuzpuz puzpuzpuz changed the title doc,test: add server.timeout property to public API doc,test: add server.timeout property to http2 public API Feb 14, 2020
@puzpuzpuz puzpuzpuz force-pushed the doc/describe-http2-server-timeout branch from 661fd6b to 06f199e Compare March 6, 2020 07:12
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().
@puzpuzpuz puzpuzpuz force-pushed the doc/describe-http2-server-timeout branch from 06f199e to 563c0ab Compare March 6, 2020 07:17
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@addaleax
Copy link
Member

Landed in 51e8f28

addaleax pushed a commit that referenced this pull request Mar 11, 2020
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 <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@addaleax addaleax closed this Mar 11, 2020
MylesBorins pushed a commit that referenced this pull request Mar 11, 2020
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 <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@MylesBorins MylesBorins mentioned this pull request Mar 12, 2020
@puzpuzpuz puzpuzpuz deleted the doc/describe-http2-server-timeout branch March 12, 2020 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. doc Issues and PRs related to the documentations. http2 Issues or PRs related to the http2 subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants