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

http2: add tests for push stream error handling #15281

Closed

Conversation

apapirovski
Copy link
Member

@apapirovski apapirovski commented Sep 8, 2017

Some test cases for pushStream edge behaviours:

  • Adds tests that cover errors for wrong arguments, as well as tests for error codes from nghttp2.

  • Also a test for the method head branch of pushStream (should close writeable stream immediately).

  • Fixes pushStream to emit NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE on session rather than
    stream.

Let me know if there's anything I can change. 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)

http2, test

@nodejs-github-bot nodejs-github-bot added the http2 Issues or PRs related to the http2 subsystem. label Sep 8, 2017
@apapirovski
Copy link
Member Author

@mcollina would you mind reviewing this? Thanks!

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM with some nits addressed.

CI: https://ci.nodejs.org/job/node-test-pull-request/10058/

common.skip('missing crypto');
const assert = require('assert');
const http2 = require('http2');

Copy link
Member

Choose a reason for hiding this comment

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

can you add a quick description of the test here?

const req = client.request(headers);

let data = '';

Copy link
Member

Choose a reason for hiding this comment

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

can you please do req.setEncoding('utf8')?

common.skip('missing crypto');
const assert = require('assert');
const http2 = require('http2');

Copy link
Member

Choose a reason for hiding this comment

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

Can you add a quick description of this test here?

Add tests that cover errors for wrong arguments, as well as
tests for error codes from nghttp2. Fix pushStream to emit
NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE on session rather than
stream.
@apapirovski
Copy link
Member Author

Thanks @mcollina. Feedback addressed and also rebased just in case.

@mcollina
Copy link
Member

@mcollina
Copy link
Member

Landed as 1aca135

@mcollina mcollina closed this Sep 13, 2017
mcollina pushed a commit that referenced this pull request Sep 13, 2017
Add tests that cover errors for wrong arguments, as well as
tests for error codes from nghttp2. Fix pushStream to emit
NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE on session rather than
stream.

PR-URL: #15281
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@apapirovski apapirovski deleted the patch-http2-pushstream-tests branch September 15, 2017 17:40
addaleax pushed a commit to addaleax/ayo that referenced this pull request Sep 17, 2017
Add tests that cover errors for wrong arguments, as well as
tests for error codes from nghttp2. Fix pushStream to emit
NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE on session rather than
stream.

PR-URL: nodejs/node#15281
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
jasnell pushed a commit that referenced this pull request Sep 20, 2017
Add tests that cover errors for wrong arguments, as well as
tests for error codes from nghttp2. Fix pushStream to emit
NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE on session rather than
stream.

PR-URL: #15281
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Qard pushed a commit to Qard/ayo that referenced this pull request Sep 21, 2017
Add tests that cover errors for wrong arguments, as well as
tests for error codes from nghttp2. Fix pushStream to emit
NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE on session rather than
stream.

PR-URL: nodejs/node#15281
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants