Skip to content

Commit 9996455

Browse files
cjihrigjoelostrowski
authored andcommitted
test: don't assume IPv6 in test-regress-nodejsGH-5727
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: nodejs#5732 PR-URL: nodejs#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]>
1 parent c6ef8ff commit 9996455

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/parallel/test-regress-GH-5727.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ const invalidPort = -1 >>> 0;
77
const errorMessage = /"port" argument must be \>= 0 and \< 65536/;
88

99
net.Server().listen(common.PORT, function() {
10-
assert.equal(this._connectionKey, '6::::' + common.PORT);
10+
const address = this.address();
11+
const key = `${address.family.slice(-1)}:${address.address}:${common.PORT}`;
12+
13+
assert.equal(this._connectionKey, key);
1114
this.close();
1215
});
1316

0 commit comments

Comments
 (0)