Subject: | t/io_multihomed6.t doesn't check for error from getaddrinfo() - causes test suite failures |
This is basically a follow-up from RT#57676 where I was having trouble
with t/io_multihomed6.t on old Linux distributions. It seems I'm not alone:
http://www.cpantesters.org/cpan/report/07347844-b19f-3f77-b713-d32bba55d77f
Anyway, the problem seems to be that getaddrinfo('localhost',1) fails on
these systems and returns an error message ("Servname not supported for
ai_socktype") instead of the expected data, resulting in the test failure:
Use of uninitialized value in subroutine entry at t/io_multihomed6.t
line 52.
Bad arg length for Socket6::unpack_sockaddr_in6, length is 0, should be
28 at t/io_multihomed6.t line 52.
t/io_multihomed6.t ....
Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run
Attached patch adds a test for this and skips the test if it happens.
It seems from the cpantesters results that a lot of people are still
getting subtests 3 and 4 of this test happening in the wrong order; that
seems to be the failure mode for most of the "FAIL" results.
Subject: | IO-Socket-INET6-2.63-getaddrinfo.patch |
--- IO-Socket-INET6-2.63/t/io_multihomed6.t.debug 2010-05-29 12:43:55.000000000 +0100
+++ IO-Socket-INET6-2.63/t/io_multihomed6.t 2010-06-07 14:46:45.104104745 +0100
@@ -46,6 +46,10 @@
{
my %resolved_addresses;
my @r = getaddrinfo('localhost',1);
+ if (@r < 5) {
+ print "1..0 # SKIP getaddrinfo('localhost',1) failed: $r[0]\n";
+ exit 0;
+ }
while (@r) {
my @values = splice(@r,0,5);
my ($fam,$addr) = @values[0,3];