Uh oh!
There was an error while loading. Please reload this page.
test: find IPv6 address from localhost names - #7806
Conversation
Try all the possible hostnames listed in `common.localIPv6Hosts` to get an IPv6 address. If none of them give a valid address, skip the tests.
bnoordhuis
commented
Jul 20, 2016
@bnoordhuis I found a way to fix that. Testing it in my local VMs. I'll update shortly. |
8abd66b to
1dccdcdCompareThe current version looks like a partial win. https://ci.nodejs.org/job/node-test-pull-request/3351/. Only two failures till now. |
d8a7243 to
1dccdcdComparethefourtheye
commented
Jul 20, 2016
Okay. All green now (Except Fedora 24, which keeps building and testing again and again). https://ci.nodejs.org/job/node-test-pull-request/3352/ |
bnoordhuis
commented
Jul 20, 2016
I have to say that the changes to test/common.js don't look very appealing but I'll defer to @nodejs/testing. |
thefourtheye
commented
Jul 20, 2016
@bnoordhuis Any suggestions to make it better? |
@bnoordhuis Will this be better? exports.getLocalIPv6Address=functiongetLocalIPv6Address(callback){if(exports.localIPv6Hosts.length===0||localhostIPv6===undefined){localhostIPv6=undefined;returnprocess.nextTick(()=>callback(newError('Unable to determine IPv6 address')));}(functionprocessNextHost(current){if(current<exports.localIPv6Hosts.length){consthost=exports.localIPv6Hosts[current];returndns.lookup(host,{family: 6},(_,addr)=>{if(addr&&typeofaddr==='string'){localhostIPv6={hostname: host,address: addr};returncallback(null,localhostIPv6);}returnprocessNextHost(current+1);});}localhostIPv6=undefined;callback(newError('Unable to determine IPv6 address'));})(0);};Edit: I probably can move the |
Trott
commented
Jul 20, 2016
I feel the same, but would be curious how more people on @nodejs/testing felt. This function seems to be only needed in two tests so it's not clear to me that |
Checklist
make -j4 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
test
Description of change
Try all the possible hostnames listed in
common.localIPv6Hoststo getan IPv6 address. If none of them give a valid address, skip the tests.
cc @nodejs/testing