Skip to content

Commit

Permalink
test: remove common.PORT from test-net-pause
Browse files Browse the repository at this point in the history
Switch test-net-pause from common.PORT to a port assigned by the
operating system.

PR-URL: #31749
Reviewed-By: Denys Otrishko <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
Trott authored and codebytere committed Feb 27, 2020
1 parent 3fbd5ab commit 87e9014
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/pummel/test-net-pause.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';
const common = require('../common');
require('../common');
const assert = require('assert');
const net = require('net');

Expand All @@ -43,7 +43,7 @@ const server = net.createServer((connection) => {
});

server.on('listening', () => {
const client = net.createConnection(common.PORT);
const client = net.createConnection(server.address().port);
client.setEncoding('ascii');
client.on('data', (d) => {
console.log(d);
Expand Down Expand Up @@ -83,7 +83,7 @@ server.on('listening', () => {
client.end();
});
});
server.listen(common.PORT);
server.listen(0);

process.on('exit', () => {
assert.strictEqual(recv.length, N);
Expand Down

0 comments on commit 87e9014

Please sign in to comment.