Skip to content

Commit

Permalink
test: don't assume IPv6 in test-regress-GH-5727
Browse files Browse the repository at this point in the history
test/parallel/test-regress-GH-5727 assumed that one of the
servers would be listening on IPv6. This breaks when the machine
running the test doesn't have IPv6. This commit builds the
connection key that is compared dynamically.

Refs: #5732
PR-URL: #6319
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
Reviewed-By: Fedor Indutny <[email protected]>
  • Loading branch information
cjihrig committed Apr 21, 2016
1 parent 7e9b0dd commit 1e4d053
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/parallel/test-regress-GH-5727.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ const invalidPort = -1 >>> 0;
const errorMessage = /"port" argument must be \>= 0 and \< 65536/;

net.Server().listen(common.PORT, function() {
assert.equal(this._connectionKey, '6::::' + common.PORT);
const address = this.address();
const key = `${address.family.slice(-1)}:${address.address}:${common.PORT}`;

assert.equal(this._connectionKey, key);
this.close();
});

Expand Down

0 comments on commit 1e4d053

Please sign in to comment.