Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
test: add common.mustCall#14262
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: add common.mustCall #14262
Uh oh!
There was an error while loading. Please reload this page.
Conversation
TimothyGu commented Jul 16, 2017
Trott commented Jul 16, 2017
This doesn't look quite correct. Instead of wrapping |
Trott commented Jul 16, 2017
(continued) So, for example, remove this: process.on('exit',()=>{assert.strictEqual(requestCount,3);});...and add code that instead checks that whatever function is incrementing constserver=http.createServer(common.mustCall((req,res)=>{requestCount++;res.end();},3)); |
Trott left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(See comments.)
Suixinlei commented Jul 16, 2017
@Trott I have take a change, please take a look |
Trott left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if CI is green!
Suixinlei commented Jul 16, 2017
@Trott I have change again, remove |
Trott commented Jul 16, 2017
Still LGTM, I think! |
vsemozhetbyt commented Jul 16, 2017
Trott commented Jul 16, 2017
CI was green, but I canceled the Raspberry PI 1 run because of our CI backlog right now. This can land, though, IMO. Would prefer to fast-track it, but would want a few more Collaborator approvals first. However, even if no one else provides a review, this can land after being open for 72 hours. |
| constserver=http.createServer((req,res)=>{ | ||
| requestCount++; | ||
| }); | ||
| constserver=http.createServer(common.mustCall((req,res)=>{},3)); |
jasnellJul 17, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the function inside the mustCall() is a non-op, this can be shortened to just:
constserver=http.createServer(common.mustCall(3));| }); | ||
| constserver=https.createServer( | ||
| serverOptions, | ||
| common.mustCall((req,res)=>{},3)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto here...
constserver=http2.createServer(serverOptions,common.mustCall(3));There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx, I have already simplify common.mustCall.this made test more readable. @jasnell
jasnell left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with green CI
Trott commented Jul 26, 2017
Trott commented Jul 26, 2017
Landed in 2e864df Thanks for the contribution! 🎉 |
PR-URL: nodejs#14262 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #14262 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: James M Snell <[email protected]>
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test