-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Conversation
return errCode; | ||
}; | ||
|
||
socket.send('foo', port, 'localhost', callback); |
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.
I guess it doesn't really matter in this case, but maybe common.localhostIPv4
assert.strictEqual(err.syscall, 'send'); | ||
assert.strictEqual(err.address, 'localhost'); | ||
assert.strictEqual(err.port, port); | ||
}); |
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.
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.
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>
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>
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>
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), orvcbuild test
(Windows) passesAffected core subsystem(s)
test