test: adding Countdown to test-http-set-cookies test#17504
test: adding Countdown to test-http-set-cookies test#17504shilomagen wants to merge 4 commits intonodejs:masterfrom
Conversation
apapirovski
left a comment
There was a problem hiding this comment.
LGTM but some small changes required
| if (req.url === '/one') { | ||
| res.writeHead(200, [['set-cookie', 'A'], | ||
| ['content-type', 'text/plain']]); | ||
| ['content-type', 'text/plain']]); |
There was a problem hiding this comment.
Could you undo this change? It should stay lined up.
| ['set-cookie', 'B'], | ||
| ['content-type', 'text/plain']]); | ||
| ['set-cookie', 'B'], | ||
| ['content-type', 'text/plain']]); |
There was a problem hiding this comment.
Same for these two lines. They should be lined up as before.
| // one set-cookie header | ||
| // | ||
| http.get({ port: this.address().port, path: '/one' }, function(res) { | ||
| http.get({port: this.address().port, path: '/one'}, function(res) { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Same as above, please add the spaces back in.
|
|
||
| let nresponses = 0; | ||
|
|
||
| const countdown = new Countdown(2, common.mustCall(() => server.close())); |
There was a problem hiding this comment.
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).
|
@apapirovski all of your comments were fixed, thanks! |
|
Landed in 6a089f9 |
PR-URL: #17504 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jon Moss <[email protected]>
PR-URL: #17504 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jon Moss <[email protected]>
PR-URL: #17504 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jon Moss <[email protected]>
PR-URL: #17504 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jon Moss <[email protected]>
PR-URL: #17504 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jon Moss <[email protected]>
PR-URL: #17504 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jon Moss <[email protected]>
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected 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