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

refac: refactor test-http-response-multiheaders.js test to use countdown #17419

Conversation

LEQADA
Copy link

@LEQADA LEQADA commented Dec 1, 2017

Refs #17169 to fix test/parallel/test-http-response-multiheaders.js

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 Dec 1, 2017
@@ -47,7 +48,7 @@ const server = http.createServer(function(req, res) {
});

server.listen(0, common.mustCall(function() {
let count = 0;
const countdown = new Countdown(2, () => server.close());
for (let n = 1; n <= 2; n++) {
Copy link
Member

Choose a reason for hiding this comment

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

Could we store 2 in a const or something? Potentially this could also be rewritten to utilize the countdown more fully (loop could be based on countdown being > 0, etc.) but at the very least we should remove magic numbers.

Copy link
Author

@LEQADA LEQADA Dec 1, 2017

Choose a reason for hiding this comment

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

@apapirovski might be a good idea. Do you have any variable name preferences? Maybe runs = 2 or runCount = 2?

Copy link
Member

Choose a reason for hiding this comment

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

Either of those sound good 👍

Copy link
Author

@LEQADA LEQADA Dec 3, 2017

Choose a reason for hiding this comment

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

@apapirovski here is the commit 6e9f719

@mscdex mscdex added the http Issues or PRs related to the http subsystem. label Dec 2, 2017
@LEQADA LEQADA force-pushed the use-countdown-test-http-response-multiheaders branch from a80a543 to 6e9f719 Compare December 3, 2017 20:17
@LEQADA
Copy link
Author

LEQADA commented Dec 3, 2017

Changed commit messages to have less than 72 chars.

Copy link
Contributor

@maclover7 maclover7 left a comment

Choose a reason for hiding this comment

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

One quick comment, then LGTM

@@ -47,8 +48,9 @@ const server = http.createServer(function(req, res) {
});

server.listen(0, common.mustCall(function() {
let count = 0;
for (let n = 1; n <= 2; n++) {
const runCount = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you move runCount to live outside of the server.listen?

Copy link
Author

Choose a reason for hiding this comment

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

@maclover7 like this afacc3e ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe so -- although the linter may want an extra blank line (you can check this via make lint-js :))

Copy link
Author

Choose a reason for hiding this comment

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

@maclover7 it says Running JS linter... and then exits. Does it mean that everything is ok? :)

Copy link
Contributor

Choose a reason for hiding this comment

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

@LEQADA Yep -- if no errors show up then all good. You can also see the linter CI job passing at https://ci.nodejs.org/job/node-test-linter/14156/

@maclover7
Copy link
Contributor

@maclover7 maclover7 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 4, 2017
@maclover7
Copy link
Contributor

Landing...

@maclover7 maclover7 self-assigned this Dec 5, 2017
@maclover7
Copy link
Contributor

Landed in 35c01d8, congrats on your first PR to Node.js!
❤️ 💚 💙 💛 💜

@maclover7 maclover7 closed this Dec 5, 2017
maclover7 pushed a commit that referenced this pull request Dec 5, 2017
PR-URL: #17419
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
@addaleax addaleax removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 7, 2017
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
PR-URL: #17419
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
PR-URL: #17419
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Dec 12, 2017
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
PR-URL: #17419
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
PR-URL: #17419
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
@gibfahn gibfahn mentioned this pull request Dec 20, 2017
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
PR-URL: #17419
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
@gibfahn gibfahn mentioned this pull request Dec 20, 2017
@MylesBorins MylesBorins mentioned this pull request Dec 20, 2017
@LEQADA LEQADA deleted the use-countdown-test-http-response-multiheaders branch March 7, 2018 18:33
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.

8 participants