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

test : updated test to use common.mustCall by mithunsasidharan · Pull Request #17437 · nodejs/node · GitHub

/ node Public

test : updated test to use common.mustCall - #17437

Closed
mithunsasidharan wants to merge 1 commit into
nodejs:masterfrom
mithunsasidharan:pr_7
Closed

test : updated test to use common.mustCall#17437
mithunsasidharan wants to merge 1 commit into
nodejs:masterfrom
mithunsasidharan:pr_7

Conversation

mithunsasidharan commented Dec 3, 2017
edited
Loading

Copy link
Copy Markdown
Contributor

refactored test case in test-http-res-write-end-dont-take-array to use common.mustCall as per issue #17169

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

nodejs-github-bot added the test Issues and PRs related to the tests. label Dec 3, 2017
mscdex added the http Issues or PRs related to the http subsystem. label Dec 3, 2017

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

This will no longer do what it claims to as the countdown is redeclared on each request. It will never go below 1 which means the callback will never fire.

In general, this test would be better if rewritten without Countdown and instead by using .once('request') with common.mustCall for the first test that would then declare on('request') with common.mustCall for the 2nd test.

Something like this basically:

server.once('request', common.mustCall((req, res) => {
  server.on('request', common.mustCall((req, res) => {
    res.end(Buffer.from('asdf'));	
  }));
  // 1st test case code here
}));

Copy link
Copy Markdown
Contributor Author

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

@apapirovski : Thanks for the feedback. I've updated the PR with the changes and also shortened the commit message. Kindly review the PR now. Thanks !

mithunsasidharan changed the title test : updated test cases in test-http-res-write-end-dont-take-array to use countdown test : updated test to use common.mustCall Dec 3, 2017

Copy link
Copy Markdown
Contributor

maclover7 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

One quick note

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

See line 23 -- common has already been required, but just not set to a variable.

Copy link
Copy Markdown
Contributor Author

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

@maclover7 : Thanks for the feedback. I've updated the PR with the changes. Kindly review now and update the CI Checks. Thanks !

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

The inclusion of common must be the first module loaded. Otherwise, it does not protect against leaked globals from other modules.

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 once common is moved to be the first module loaded and if CI is OK.

Copy link
Copy Markdown
Contributor Author

@Trott : Thanks for the feedback. I've moved up common to be the first module loaded. Kindly review the PR now. Thanks !

Copy link
Copy Markdown
Contributor

maclover7 added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Dec 5, 2017

Copy link
Copy Markdown
Contributor Author

@maclover7 : Curious why test/linux-one failed ?

Copy link
Copy Markdown
Contributor

@mithunsasidharan It looks like it's an unrelated failure, and the rest of the CI is green, so things should be okay.

Copy link
Copy Markdown
Contributor Author

@apapirovski : Can you please land this ? Thanks a lot !

Copy link
Copy Markdown
Contributor

Landed in bb59063

Thank you for your contribution!

apapirovski closed this Dec 6, 2017
apapirovski pushed a commit that referenced this pull request Dec 6, 2017
PR-URL: #17437
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
mithunsasidharan deleted the pr_7 branch December 6, 2017 14:31
addaleax removed the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Dec 7, 2017
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
PR-URL: #17437
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
PR-URL: #17437
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
MylesBorins mentioned this pull request Dec 12, 2017
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
PR-URL: #17437
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
gibfahn mentioned this pull request Dec 20, 2017
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
PR-URL: #17437
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
gibfahn mentioned this pull request Dec 20, 2017
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.


Back | FazBrowse Home | New Git URL