Skip to content

Conversation

@Suixinlei
Copy link
Contributor

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-botnodejs-github-bot added the test Issues and PRs related to the tests. label Jul 16, 2017
@benglbengl added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Jul 16, 2017
@TimothyGu
Copy link
Member

@Trott
Copy link
Member

This doesn't look quite correct.

Instead of wrapping process.on('exit',...) in common.mustCall(), you probably want to remove process.on('exit',...) entirely and replace it with common.mustCall() usage.

@Trott
Copy link
Member

(continued) So, for example, remove this:

process.on('exit',()=>{assert.strictEqual(requestCount,3);});

...and add code that instead checks that whatever function is incrementing requestCount is called exactly 3 times:

constserver=http.createServer(common.mustCall((req,res)=>{requestCount++;res.end();},3));

Copy link
Member

@TrottTrott left a comment

Choose a reason for hiding this comment

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

(See comments.)

@TimothyGuTimothyGu added code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. and removed code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. labels Jul 16, 2017
@Suixinlei
Copy link
ContributorAuthor

@Trott I have take a change, please take a look

Copy link
Member

@TrottTrott left a 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
Copy link
ContributorAuthor

@Trott I have change again, remove res.end() in serverNoEndKeepAliveTimeoutWithPipeline . please take a look again~

@Trott
Copy link
Member

Still LGTM, I think!
Thanks for the contribution! 🎉

@vsemozhetbyt
Copy link
Contributor

@Trott
Copy link
Member

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));
Copy link
Member

@jasnelljasnellJul 17, 2017

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));
Copy link
Member

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));

Copy link
ContributorAuthor

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

Copy link
Member

@jasnelljasnell left a 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
Copy link
Member

@Trott
Copy link
Member

Landed in 2e864df

Thanks for the contribution! 🎉

@TrottTrott closed this Jul 26, 2017
Trott pushed a commit to Trott/io.js that referenced this pull request Jul 26, 2017
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]>
addaleax pushed a commit that referenced this pull request Jul 27, 2017
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]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-and-learnIssues related to the Code-and-Learn events and PRs submitted during the events.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

12 participants

@Suixinlei@TimothyGu@Trott@vsemozhetbyt@jasnell@addaleax@cjihrig@hiroppy@gireeshpunathil@bengl@MylesBorins@nodejs-github-bot