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: http2 client setNextStreamID errors #18848

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Feb 18, 2018

This code changes adds tests to test following errors in setNextStreamID:

if (typeof id !== 'number')
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'id', 'number');
if (id <= 0 || id > kMaxStreams)
throw new errors.RangeError('ERR_OUT_OF_RANGE', 'id',
`> 0 and <= ${kMaxStreams}`, id);

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

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Feb 18, 2018
);

// should throw if something other than number is passed to setNextStreamID
Object.keys(types).forEach((type) => {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: how about using Object.entries(types).forEach(([ type, value ]) => { ... })

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@trivikr trivikr force-pushed the test-http2-client-setNextStreamID-errors branch from 13e3735 to 0909275 Compare February 18, 2018 06:59
@lpinca
Copy link
Member

lpinca commented Feb 18, 2018

}
);

// should throw if something other than number is passed to setNextStreamID
Copy link
Member

Choose a reason for hiding this comment

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

Nit: please always use a capital letter as first character and punctuate your comments.

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 18, 2018
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Feb 22, 2018
PR-URL: nodejs#18848
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@BridgeAR
Copy link
Member

Landed in 20dae85 🎉

@BridgeAR BridgeAR closed this Feb 22, 2018
MylesBorins pushed a commit that referenced this pull request Mar 6, 2018
PR-URL: #18848
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Mar 6, 2018
MylesBorins pushed a commit that referenced this pull request Mar 6, 2018
PR-URL: #18848
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request Mar 6, 2018
PR-URL: #18848
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@targos targos removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 17, 2018
targos pushed a commit to targos/node that referenced this pull request Mar 17, 2018
PR-URL: nodejs#18848
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@targos
Copy link
Member

targos commented Mar 17, 2018

Backport to 9.x: #19413

MylesBorins pushed a commit that referenced this pull request Mar 20, 2018
Backport-PR-URL: #18848
PR-URL: #18848
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request Mar 20, 2018
Backport-PR-URL: #18848
PR-URL: #18848
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@targos targos mentioned this pull request Mar 20, 2018
@trivikr trivikr deleted the test-http2-client-setNextStreamID-errors branch April 14, 2018 21:17
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
PR-URL: nodejs#18848
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@MylesBorins
Copy link
Contributor

test breaks on v8.x, opting to not land

Path: parallel/test-http2-client-setNextStreamID-errors
(node:85382) ExperimentalWarning: The http2 module is an experimental API.
assert.js:42
  throw new errors.AssertionError({
  ^

AssertionError [ERR_ASSERTION]: 'The "%s" argument is out of range' === 'The "id" argument is out of range'
    at Object.innerFn (/Users/mborins/code/node/v8.x/test/common/index.js:709:16)
    at expectedException (assert.js:614:19)
    at innerThrows (assert.js:648:21)
    at Function.throws (assert.js:662:3)
    at Object.expectsError (/Users/mborins/code/node/v8.x/test/common/index.js:731:12)
    at ClientHttp2Session.client.on (/Users/mborins/code/node/v8.x/test/parallel/test-http2-client-setNextStreamID-errors.js:30:12)
    at emitTwo (events.js:126:13)
    at ClientHttp2Session.emit (events.js:214:7)
    at emit (internal/http2/core.js:165:8)
    at _combinedTickCallback (internal/process/next_tick.js:145:20)
Command: out/Release/node /Users/mborins/code/node/v8.x/test/parallel/test-http2-client-setNextStreamID-errors.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants