Skip to content

test: cover dgram handle send failures - #13158

Merged
cjihrig merged 1 commit into
nodejs:masterfrom
cjihrig:coverage
May 25, 2017
Merged

test: cover dgram handle send failures#13158
cjihrig merged 1 commit into
nodejs:masterfrom
cjihrig:coverage

Conversation

@cjihrig

Copy link
Copy Markdown
Contributor

This commit adds test coverage for the case where a dgram socket successfully binds, but the handle's send() function fails.

This was previously covered, but the recent churn in the dgram tests seems to have undone that coverage.

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 May 22, 2017
@mscdexmscdex added the dgram Issues and PRs related to the dgram subsystem / UDP. label May 22, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess it doesn't really matter in this case, but maybe common.localhostIPv4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe add an assertion for the message format. Something like:

assert.strictEqual(err.message,`${err.syscall}${err.code}${err.address}:${err.port} `+`- Local (${err.localAddress}:${err.localPort})`);

Silly but cheap.

@cjihrig

Copy link
Copy Markdown
ContributorAuthor

This commit adds test coverage for the case where a dgram socket
successfully binds, but the handle's send() function fails.
PR-URL: nodejs#13158
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@cjihrig
cjihrig merged commit 06757cd into nodejs:masterMay 25, 2017
@cjihrig
cjihrig deleted the coverage branch May 25, 2017 18:03
jasnell pushed a commit that referenced this pull request May 25, 2017
This commit adds test coverage for the case where a dgram socket
successfully binds, but the handle's send() function fails.
PR-URL: #13158
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
jasnell pushed a commit that referenced this pull request May 28, 2017
This commit adds test coverage for the case where a dgram socket
successfully binds, but the handle's send() function fails.
PR-URL: #13158
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@jasnelljasnell mentioned this pull request May 28, 2017
@gibfahngibfahn mentioned this pull request Jun 15, 2017
3 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dgramIssues and PRs related to the dgram subsystem / UDP.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@cjihrig@refack@jasnell@lpinca@mscdex@MylesBorins@nodejs-github-bot