Skip to content

Commit

Permalink
test: fix test-net-pingpong pummel test for non-IPv6 hosts
Browse files Browse the repository at this point in the history
Use `common.hasIPv6` instead of an OS check for more reliable
operation.

PR-URL: #34359
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
  • Loading branch information
Trott authored and addaleax committed Sep 22, 2020
1 parent 7c7d3e3 commit 2ab3fcc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/pummel/test-net-pingpong.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,8 @@ function pingPongTest(host, on_complete) {
pingPongTest('localhost');
pingPongTest(null);

// This IPv6 isn't working on Solaris.
if (!common.isSunOS) pingPongTest('::1');
if (common.hasIPv6) pingPongTest('::1');

process.on('exit', function() {
assert.strictEqual(tests_run, common.isSunOS ? 2 : 3);
assert.strictEqual(tests_run, common.hasIPv6 ? 3 : 2);
});

0 comments on commit 2ab3fcc

Please sign in to comment.