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: adding Countdown to test-http-set-cookies test #17504

Closed
wants to merge 4 commits into from

Conversation

shilomagen
Copy link
Contributor

@shilomagen shilomagen commented Dec 6, 2017

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

Hi, first PR to NodeJS.
Worked on improving test by using Countdown:
#17169
Worked on file test-http-set-cookies.js

#goodnesssquad

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Dec 6, 2017
Copy link
Member

@apapirovski apapirovski left a comment

Choose a reason for hiding this comment

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

LGTM but some small changes required

const server = http.createServer(function(req, res) {
if (req.url === '/one') {
res.writeHead(200, [['set-cookie', 'A'],
['content-type', 'text/plain']]);
['content-type', 'text/plain']]);
Copy link
Member

Choose a reason for hiding this comment

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

Could you undo this change? It should stay lined up.

['set-cookie', 'B'],
['content-type', 'text/plain']]);
['set-cookie', 'B'],
['content-type', 'text/plain']]);
Copy link
Member

Choose a reason for hiding this comment

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

Same for these two lines. They should be lined up as before.

@@ -44,7 +44,7 @@ server.on('listening', function() {
//
// one set-cookie header
//
http.get({ port: this.address().port, path: '/one' }, function(res) {
http.get({port: this.address().port, path: '/one'}, function(res) {
Copy link
Member

Choose a reason for hiding this comment

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

Please keep the space to the left and right within the braces.

});
});

});

process.on('exit', function() {
assert.strictEqual(2, nresponses);
assert.strictEqual(countdown.remaining, 0);
Copy link
Member

Choose a reason for hiding this comment

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

The process.on('exit') can be removed as server.close() needs to run before the process will exit.

});
});

// two set-cookie headers

http.get({ port: this.address().port, path: '/two' }, function(res) {
http.get({port: this.address().port, path: '/two'}, function(res) {
Copy link
Member

Choose a reason for hiding this comment

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

Same as above, please add the spaces back in.

Copy link
Member

@apapirovski apapirovski left a comment

Choose a reason for hiding this comment

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

LGTM


let nresponses = 0;

const countdown = new Countdown(2, common.mustCall(() => server.close()));
Copy link
Member

@apapirovski apapirovski Dec 6, 2017

Choose a reason for hiding this comment

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

This doesn't strictly need the common.mustCall but it's not a deal breaker. (If you do remove it, you'll need to also remove the const common = part above (but keep the actual require).

@shilomagen
Copy link
Contributor Author

shilomagen commented Dec 6, 2017

@apapirovski all of your comments were fixed, thanks!

@shilomagen shilomagen changed the title adding Countdown to test-http-set-cookies test #goodnessSquad adding Countdown to test-http-set-cookies test Dec 6, 2017
@shilomagen shilomagen changed the title adding Countdown to test-http-set-cookies test test: adding Countdown to test-http-set-cookies test Dec 7, 2017
@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 8, 2017
@maclover7
Copy link
Contributor

@apapirovski
Copy link
Member

Landed in 6a089f9

@apapirovski apapirovski closed this Dec 8, 2017
apapirovski pushed a commit that referenced this pull request Dec 8, 2017
PR-URL: #17504
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
PR-URL: #17504
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
PR-URL: #17504
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
@MylesBorins MylesBorins mentioned this pull request Dec 12, 2017
@addaleax addaleax removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 13, 2017
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
PR-URL: #17504
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
PR-URL: #17504
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
@gibfahn gibfahn mentioned this pull request Dec 20, 2017
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
PR-URL: #17504
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
@gibfahn gibfahn mentioned this pull request Dec 20, 2017
@MylesBorins MylesBorins mentioned this pull request Dec 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants