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

test: add http2 test for method CONNECT #15052

Closed

Conversation

apapirovski
Copy link
Member

Adds test case for default handling of method CONNECT, as well as the ability to bind a connect listener and handle the request. Part of the request for increased code coverage for http2, as per #14985

Let me know if I can change anything. Thanks!

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Aug 27, 2017
@mscdex mscdex added the http2 Issues or PRs related to the http2 subsystem. label Aug 27, 2017
Adds test case for default handling of method CONNECT, as well
as the ability to bind a connect listener and handle the request.

Refs: nodejs#14985

function testMethodConnect(testsToRun) {
if (!testsToRun) {
return server.close();
Copy link
Member

Choose a reason for hiding this comment

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

Just pointing out... we now have a "countdown" utility that can be used to improve this kind of logic.

For instance,

const Countdown = require('../common/countdown');
const countdown = new Countdown(2, () => console.log('done!') );
countdown.dec();
countdown.dec();

The callback based into Countdown will be called automatically and synchronously when the internal counter reaches zero.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @jasnell, that's super useful. Will definitely use it in the future! Did you want me to update this test as well or good as is?

Copy link
Member

Choose a reason for hiding this comment

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

It's good as is. We can convert over to the countdown util separately

@BridgeAR
Copy link
Member

@BridgeAR
Copy link
Member

Landed in 88441f6

@BridgeAR BridgeAR closed this Aug 30, 2017
BridgeAR pushed a commit that referenced this pull request Aug 30, 2017
Adds test case for default handling of method CONNECT, as well
as the ability to bind a connect listener and handle the request.

PR-URL: #15052
Refs: #14985
Reviewed-By: James M Snell <jasnell@gmail.com>
cjihrig pushed a commit to cjihrig/node that referenced this pull request Aug 31, 2017
Adds test case for default handling of method CONNECT, as well
as the ability to bind a connect listener and handle the request.

PR-URL: nodejs#15052
Refs: nodejs#14985
Reviewed-By: James M Snell <jasnell@gmail.com>
@apapirovski apapirovski deleted the patch-http2-connect-test branch September 4, 2017 14:36
addaleax pushed a commit to addaleax/ayo that referenced this pull request Sep 5, 2017
Adds test case for default handling of method CONNECT, as well
as the ability to bind a connect listener and handle the request.

PR-URL: nodejs/node#15052
Refs: nodejs/node#14985
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Sep 10, 2017
Adds test case for default handling of method CONNECT, as well
as the ability to bind a connect listener and handle the request.

PR-URL: #15052
Refs: #14985
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Sep 10, 2017
MylesBorins pushed a commit that referenced this pull request Sep 12, 2017
Adds test case for default handling of method CONNECT, as well
as the ability to bind a connect listener and handle the request.

PR-URL: #15052
Refs: #14985
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

6 participants