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: cover dgram handle send failures #13158

Merged
merged 1 commit into from May 25, 2017

Conversation

@cjihrig
Copy link
Contributor

commented May 22, 2017

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

@mscdex mscdex added the dgram label May 22, 2017

test/parallel/test-dgram-send-error.js Outdated
return errCode;
};

socket.send('foo', port, 'localhost', callback);

This comment has been minimized.

Copy link
@refack

refack May 22, 2017

Member

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

test/parallel/test-dgram-send-error.js Outdated
assert.strictEqual(err.syscall, 'send');
assert.strictEqual(err.address, 'localhost');
assert.strictEqual(err.port, port);
});

This comment has been minimized.

Copy link
@refack

refack May 22, 2017

Member

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.

@lpinca
lpinca approved these changes May 23, 2017

@cjihrig cjihrig force-pushed the cjihrig:coverage branch May 25, 2017

@cjihrig

This comment has been minimized.

Copy link
Contributor Author

commented May 25, 2017

test: cover dgram handle send failures
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>

@cjihrig cjihrig force-pushed the cjihrig:coverage branch to 06757cd May 25, 2017

@cjihrig cjihrig merged commit 06757cd into nodejs:master May 25, 2017

@cjihrig cjihrig deleted the cjihrig:coverage branch May 25, 2017

jasnell added a commit that referenced this pull request May 25, 2017
test: cover dgram handle send failures
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 added a commit that referenced this pull request May 28, 2017
test: cover dgram handle send failures
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 jasnell referenced this pull request May 28, 2017
@gibfahn gibfahn referenced this pull request Jun 15, 2017
2 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.