FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: wrap callbacks in mustCall() for test-http-agent-destroyed-socket.js by shubheksha · Pull Request #11201 · nodejs/node · GitHub

/ node Public

test: wrap callbacks in mustCall() for test-http-agent-destroyed-socket.js - #11201

Closed
shubheksha wants to merge 2 commits into
nodejs:masterfrom
shubheksha:fix-mustCall-test-http-agent-destroyed-socket
Closed

test: wrap callbacks in mustCall() for test-http-agent-destroyed-socket.js #11201
shubheksha wants to merge 2 commits into
nodejs:masterfrom
shubheksha:fix-mustCall-test-http-agent-destroyed-socket

Conversation

Copy link
Copy Markdown
Contributor

Wrap the callbacks which make assertions in common.mustcall() to ensure they are called

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

Tests for http

Wrap the callbacks which make assertions in common.mustcall() to ensure they are called
nodejs-github-bot added the test Issues and PRs related to the tests. label Feb 6, 2017

Trott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM if CI is green. Would prefer to not add the two new console.log() statements if there isn't a super-compelling reason to do so.

request1.socket.destroy();

response.once('close', function() {
console.log('called');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nit: remove debugging addition?

process.nextTick(common.mustCall(function() {
// assert that the same socket was not assigned to request2,
// since it was destroyed.
console.log('called 2');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nit: remove this one too?

Trott added the http Issues or PRs related to the http subsystem. label Feb 6, 2017

Trott commented Feb 6, 2017

Copy link
Copy Markdown
Member

cjihrig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM, but it looks like one more could be added on line 47 (response.once('close').

Trott commented Feb 6, 2017

Copy link
Copy Markdown
Member

LGTM, but it looks like one more could be added on line 47 (response.once('close').

@cjihrig That callback does not execute at all when I run the test. (Should it? If so, I think there's a bug.) Perhaps it is there to either handle a race condition or else is platform-dependent? The big comment a few lines above it seems relevant.

cjihrig commented Feb 7, 2017

Copy link
Copy Markdown
Contributor

Yea, that comment does seem relevant. It should be fine to leave line 47 alone since it might not execute. It seems less than ideal to have cases like that in our tests, but that has nothing to do with this PR.

Trott commented Feb 7, 2017

Copy link
Copy Markdown
Member

jasnell pushed a commit that referenced this pull request Feb 11, 2017
* wrap callbacks in mustCall()
* Wrap the callbacks which make assertions in common.mustcall()
  to ensure they are called

PR-URL: #11201
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

jasnell commented Feb 11, 2017

Copy link
Copy Markdown
Member

Landed in 3d2bd7a

jasnell closed this Feb 11, 2017
italoacasas pushed a commit that referenced this pull request Feb 13, 2017
* wrap callbacks in mustCall()
* Wrap the callbacks which make assertions in common.mustcall()
  to ensure they are called

PR-URL: #11201
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Feb 14, 2017
* wrap callbacks in mustCall()
* Wrap the callbacks which make assertions in common.mustcall()
  to ensure they are called

PR-URL: nodejs#11201
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
krydos pushed a commit to krydos/node that referenced this pull request Feb 25, 2017
* wrap callbacks in mustCall()
* Wrap the callbacks which make assertions in common.mustcall()
  to ensure they are called

PR-URL: nodejs#11201
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

jasnell commented Mar 7, 2017

Copy link
Copy Markdown
Member

needs a backport PR to land in v6 or v4

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

http Issues or PRs related to the http subsystem. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL