mirror of
https://github.com/nodejs/node.git
synced 2025-08-16 06:08:50 +02:00
test: fixed flaky test-net-connect-local-error
Fixed test-net-connect-local-error by moving the test from parallel to sequential. PR-URL: https://github.com/nodejs/node/pull/12964 Fixes: https://github.com/nodejs/node/issues/12950 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
parent
008301167e
commit
0c2edd27e6
1 changed files with 11 additions and 8 deletions
|
@ -1,27 +0,0 @@
|
|||
'use strict';
|
||||
const common = require('../common');
|
||||
const assert = require('assert');
|
||||
const net = require('net');
|
||||
|
||||
const server = net.createServer();
|
||||
server.listen(0);
|
||||
const port = server.address().port;
|
||||
const client = net.connect({
|
||||
port: port + 1,
|
||||
localPort: port,
|
||||
localAddress: common.localhostIPv4
|
||||
});
|
||||
|
||||
client.on('error', common.mustCall(function onError(err) {
|
||||
assert.strictEqual(
|
||||
err.localPort,
|
||||
port,
|
||||
`${err.localPort} !== ${port} in ${err}`
|
||||
);
|
||||
assert.strictEqual(
|
||||
err.localAddress,
|
||||
common.localhostIPv4,
|
||||
`${err.localAddress} !== ${common.localhostIPv4} in ${err}`
|
||||
);
|
||||
}));
|
||||
server.close();
|
Loading…
Add table
Add a link
Reference in a new issue