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: add coverage for socket write after close #13171

Merged
merged 1 commit into from
May 26, 2017
Merged

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented May 23, 2017

This commit adds test coverage for the scenario where a socket's
handle has been closed prior to writing.

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 nodejs-github-bot added the test Issues and PRs related to the tests. label May 23, 2017
@mscdex mscdex added the net Issues and PRs related to the net subsystem. label May 23, 2017
const client = net.connect({port}, common.mustCall(() => {
client.on('error', common.mustCall((err) => {
server.close();
assert.strictEqual(err.message, 'write EBADF');
Copy link
Member

Choose a reason for hiding this comment

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

Nit: can we add an assertion for the error class?

assert.strictEqual(err.constructor, Error);

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

@cjihrig cjihrig force-pushed the connect branch 2 times, most recently from 29b2993 to 7169523 Compare May 25, 2017 18:20
@cjihrig
Copy link
Contributor Author

cjihrig commented May 25, 2017

This commit adds test coverage for the scenario where a socket's
handle has been closed prior to writing.

PR-URL: nodejs#13171
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@cjihrig cjihrig merged commit 6a18c1d into nodejs:master May 26, 2017
@cjihrig cjihrig deleted the connect branch May 26, 2017 16:24
jasnell pushed a commit that referenced this pull request May 28, 2017
This commit adds test coverage for the scenario where a socket's
handle has been closed prior to writing.

PR-URL: #13171
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@jasnell jasnell mentioned this pull request May 28, 2017
@gibfahn gibfahn mentioned this pull request Jun 15, 2017
3 tasks
MylesBorins pushed a commit that referenced this pull request Jul 17, 2017
This commit adds test coverage for the scenario where a socket's
handle has been closed prior to writing.

PR-URL: #13171
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
net Issues and PRs related to the net subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants