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 stored settings returned when present #15751

Closed
wants to merge 1 commit into from

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Oct 3, 2017

This PR adds test to confirm that stored settings are returned when they're available in Http2Stream

It covers following lines:

if (settings !== undefined)
return settings;

if (settings !== undefined)
return settings;

Refs: #14985

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, http2

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Oct 3, 2017
@lpinca
Copy link
Member

lpinca commented Oct 3, 2017

@mscdex mscdex added the http2 Issues or PRs related to the http2 subsystem. label Oct 3, 2017
@apapirovski
Copy link
Member

apapirovski commented Oct 3, 2017

This is just a nit but the current implementation requires checking the code coverage to confirm that the test is succeeding (the test will never fail, even if the caching is removed). A simple change could be to store the local settings and remote settings that are returned from the first call and then confirming that the objects that are retrieved the 2nd time are one and the same (strictEqual).

const localSettings = stream.session.localSettings;
const remoteSettings = stream.session.remoteSettings;
assertSettings(localSettings);
assertSettings(remoteSettings);

// Test that stored settings are returned when called for second time
assert.strictEqual(stream.session.localSettings, localSettings);
assert.strictEqual(stream.session.remoteSettings, remoteSettings);

@trivikr trivikr force-pushed the test-http2-session-settings branch from 1582da4 to 0c6f788 Compare October 3, 2017 15:54
@trivikr
Copy link
Member Author

trivikr commented Oct 3, 2017

@apapirovski Thanks for the comment 👍
I've incorporated it in the commit.

@benjamingr
Copy link
Member

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

@mcollina
Copy link
Member

mcollina commented Oct 7, 2017

Landed as fabd618

@mcollina mcollina closed this Oct 7, 2017
mcollina pushed a commit that referenced this pull request Oct 7, 2017
Refs: #14985
PR-URL: #15751
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@trivikr trivikr deleted the test-http2-session-settings branch October 7, 2017 18:35
MylesBorins pushed a commit that referenced this pull request Oct 7, 2017
Refs: #14985
PR-URL: #15751
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Oct 7, 2017
MylesBorins pushed a commit that referenced this pull request Oct 11, 2017
Refs: #14985
PR-URL: #15751
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
addaleax pushed a commit to addaleax/ayo that referenced this pull request Oct 12, 2017
Refs: #14985
PR-URL: nodejs/node#15751
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@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.

10 participants