Skip to content

test: update test-http-timeout-overflow to use common.mustCall - #17528

Closed
collin5 wants to merge 2 commits into
nodejs:masterfrom
collin5:fix-issue-17169
Closed

test: update test-http-timeout-overflow to use common.mustCall#17528
collin5 wants to merge 2 commits into
nodejs:masterfrom
collin5:fix-issue-17169

Conversation

@collin5

@collin5collin5 commented Dec 7, 2017

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

Updated tests in /test/parallel/test-http-timeout-overflow.js to use Countdown module.

Ref issue #17169

@nodejs-github-botnodejs-github-bot added the test Issues and PRs related to the tests. label Dec 7, 2017

@apapirovskiapapirovski 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.

Hi @collin5 — thank you for taking this on! this particular test would be better with using common.mustCall for both the function within http.createServer and within res.on('end'). Then the process.on('exit') block can also be removed.

Countdown is better when used for tests where n > 1.

response.end('OK');
});

const server = http.createServer(function(req, res) {

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.

This could be common.mustCall(function(req, res) { /* function body */ }) which would then confirm that it executes during the duration of the test. Then no Countdown is needed.

@collin5collin5Dec 8, 2017

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@apapirovski Right, that actually makes more sense. Let me do it ASAP 👍

@@ -45,8 +50,7 @@ server.listen(0, function() {
req.clearTimeout(callback);

res.on('end', function() {

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.

This can also use common.mustCall so common.mustCall(function() { /* function body */ }).

@collin5

collin5 commented Dec 8, 2017

Copy link
Copy Markdown
ContributorAuthor

@apapirovski Thanks for the feedback, I've pushed the changes 👍.
I've also realized that this also applies to some of the tests we have in this list. I think adding info of what tests should use common.mustCall over the Countdown module may be a good idea.

@apapirovskiapapirovski 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.

LGTM. Thanks for making the changes!

@apapirovski

Copy link
Copy Markdown
Contributor

@apapirovskiapapirovski changed the title test: update test-http-timeout-overflow to use countdown timertest: update test-http-timeout-overflow to use common.mustCallDec 8, 2017
@apapirovski

Copy link
Copy Markdown
Contributor

Landed in d2626ef. Thank you for your contribution, @collin5, and congrats on becoming a Contributor! 🎉

apapirovski pushed a commit that referenced this pull request Dec 9, 2017
PR-URL: #17528
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
@collin5

Copy link
Copy Markdown
ContributorAuthor

@apapirovski Thank you too 👍

@collin5
collin5 deleted the fix-issue-17169 branch December 9, 2017 21:04
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
PR-URL: #17528
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
PR-URL: #17528
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
@MylesBorinsMylesBorins mentioned this pull request Dec 12, 2017
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
PR-URL: #17528
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
@gibfahngibfahn mentioned this pull request Dec 20, 2017
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
PR-URL: #17528
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
@gibfahngibfahn mentioned this pull request Dec 20, 2017
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
PR-URL: #17528
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@collin5@apapirovski@gibfahn@nodejs-github-bot