test: fix test-net-pingpong pummel test for non-IPv6 hosts

Use `common.hasIPv6` instead of an OS check for more reliable
operation.

PR-URL: https://github.com/nodejs/node/pull/34359
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
This commit is contained in:
Rich Trott committed 2020-07-16 14:28:41 -07:00
1 parent a55b77d2d3
commit 5487054225
1 file changed
+2 -3
+2 -3
View File
@@ -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);
});