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: reach res._dump after abort ClientRequest #24191

Conversation

tadhgcreedon
Copy link
Contributor

@tadhgcreedon tadhgcreedon commented Nov 6, 2018

Adds test coverage to lib/_http_client.js by reaching a line of code inside a callback that gets registered on the 'response' event after aborting a client request, by emitting that event.

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

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Nov 6, 2018
@addaleax addaleax added http Issues or PRs related to the http subsystem. code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. labels Nov 6, 2018
@tadhgcreedon tadhgcreedon force-pushed the http-client-request-abort-response-dump branch from 73a1820 to 4359904 Compare November 7, 2018 10:33
@addaleax
Copy link
Member

@tadhgcreedon I’m not sure, but would it maybe make sense to test both cases here, e.g. by creating a new test file rather than modifying an existing one? I think this might be affecting the previous functionality of the test…

(/cc @nodejs/http)

@jasnell
Copy link
Member

jasnell commented Nov 10, 2018

Yeah, a separate new test file may be better

@tadhgcreedon
Copy link
Contributor Author

tadhgcreedon commented Nov 11, 2018

Sure, makes sense. Will create a new test file then update.

@tadhgcreedon tadhgcreedon force-pushed the http-client-request-abort-response-dump branch from 3179181 to 1a544be Compare November 11, 2018 12:50
@oyyd
Copy link
Contributor

oyyd commented Nov 13, 2018

@trivikr
Copy link
Member

trivikr commented Nov 13, 2018

Hi @tadhgcreedon, the author of the commits in this PR is not registered on GitHub (steps defined here)

Either:

  • add the email ID associated with the commit to GitHub
  • change the author of the commit to current email ID registered with the GitHub by following these steps

@tadhgcreedon tadhgcreedon force-pushed the http-client-request-abort-response-dump branch from 1a544be to c37a91d Compare November 13, 2018 17:23
@Trott
Copy link
Member

Trott commented Nov 14, 2018

@oyyd
Copy link
Contributor

oyyd commented Nov 14, 2018

@Trott
Copy link
Member

Trott commented Nov 14, 2018

@addaleax LGTY?


req.end();
req.abort();
req.abort();
Copy link
Contributor

Choose a reason for hiding this comment

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

Havn't checked this completely, but two req.aborts are intentional?

Copy link
Member

Choose a reason for hiding this comment

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

/ping @tadhgcreedon Two abort() calls like that are intentional? If so, great. If not, can you remove one? Or I can totally remove one. Either way. I just want to see this get merged....

@Trott
Copy link
Member

Trott commented Nov 28, 2018

@Trott
Copy link
Member

Trott commented Nov 29, 2018

Trott pushed a commit to Trott/io.js that referenced this pull request Nov 29, 2018
PR-URL: nodejs#24191
Reviewed-By: Ouyang Yadong <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
@Trott
Copy link
Member

Trott commented Nov 29, 2018

Landed in f5b8853.

Thanks for the contribution! 🎉

(If you're interested in other possible contributions to Node.js but don't have a good idea of where to start looking, some ideas are posted at https://www.nodetodo.org/next-steps/.)

refack pushed a commit to refack/node that referenced this pull request Jan 14, 2019
PR-URL: nodejs#24191
Reviewed-By: Ouyang Yadong <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
BethGriggs pushed a commit that referenced this pull request Feb 12, 2019
PR-URL: #24191
Reviewed-By: Ouyang Yadong <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
@BethGriggs BethGriggs mentioned this pull request Feb 12, 2019
rvagg pushed a commit that referenced this pull request Feb 28, 2019
PR-URL: #24191
Reviewed-By: Ouyang Yadong <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. 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.

9 participants