-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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: fix sequential test-net-connect-local-error #13064
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,28 +3,23 @@ const common = require('../common'); | |
const assert = require('assert'); | ||
const net = require('net'); | ||
|
||
// EADDRINUSE is expected to occur on FreeBSD | ||
// Please see https://github.com/nodejs/node/issues/13055 for more details | ||
const expectedErrorCodes = ['ECONNREFUSED', 'EADDRINUSE']; | ||
const client = net.connect({ | ||
port: common.PORT + 1, | ||
localPort: common.PORT, | ||
port: common.PORT, | ||
localPort: common.PORT + 1, | ||
localAddress: common.localhostIPv4 | ||
}); | ||
|
||
client.on('error', common.mustCall(function onError(err) { | ||
assert.ok(expectedErrorCodes.includes(err.code)); | ||
assert.strictEqual(err.syscall, 'connect'); | ||
assert.strictEqual(err.code, 'ECONNREFUSED'); | ||
assert.strictEqual( | ||
err.localPort, | ||
common.PORT, | ||
`${err.localPort} !== ${common.PORT} in ${err}` | ||
); | ||
assert.strictEqual( | ||
err.localAddress, | ||
common.localhostIPv4, | ||
`${err.localAddress} !== ${common.localhostIPv4} in ${err}` | ||
); | ||
assert.strictEqual(err.localPort, common.PORT + 1); | ||
assert.strictEqual(err.localAddress, common.localhostIPv4); | ||
assert.strictEqual( | ||
err.message, | ||
`connect ECONNREFUSED ${err.address}:${err.port} ` + | ||
`connect ${err.code} ${err.address}:${err.port} ` + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we 100% sure that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFACT they come from the same mechanism. |
||
`- Local (${err.localAddress}:${err.localPort})` | ||
); | ||
})); |
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.
Change to:
Ref: https://github.com/nodejs/node/issues/13055
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.
NM. I'll do it.