Skip Menu |

This queue is for tickets about the POE CPAN distribution.

Report information
The Basics
Id: 50079
Status: resolved
Priority: 0/
Queue: POE

People
Owner: Nobody in particular
Requestors: acferen [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.269
Fixed in: (no value)



Subject: t/30_loops/select/wheel_sf_ipv6.t (FAILS on Win32)
# r2672 introduces this particular failure. S:\poe\trunk\poe>prove -b t/30_loops/select/wheel_sf_ipv6.t t/30_loops/select/wheel_sf_ipv6....# This test may hang if your firewall blocks IPv6 # packets across your localhost interface. getsockname() on unopened socket GEN0 at blib\lib/POE/Wheel/SocketFactory.pm line 425. Use of uninitialized value in subroutine entry at C:\Perl\site\lib\POE\Test\Loops/wheel_sf_ipv6.pm line 72. t/30_loops/select/wheel_sf_ipv6....ok 1/3Bad arg length for Socket6::unpack_sockaddr_in6, length is 0, should be 28 at C:\Perl\site\lib\POE\Test\Loops/wheel_sf_ipv6.pm line 72. Compilation failed in require at t/30_loops/select/wheel_sf_ipv6.t line 20. # Looks like you planned 3 tests but ran 1. # Looks like your test exited with 2 just after 1. t/30_loops/select/wheel_sf_ipv6....dubious Test returned status 2 (wstat 512, 0x200) DIED. FAILED tests 2-3 Failed 2/3 tests, 33.33% okay (less 1 skipped test: 0 okay, 0.00%) Failed Test Stat Wstat Total Fail List of Failed ------------------------------------------------------------------------------- t/30_loops/select/wheel_sf_ipv6.t 2 512 3 4 2-3 1 subtest skipped. Failed 1/1 test scripts. 2/3 subtests failed. Files=1, Tests=3, 2 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00 CPU) Failed 1/1 test programs. 2/3 subtests failed.
This change sets the port to 0 so that a free port may be automatically allocated. In what way is this the wrong thing to do on Win32 platforms? On Mon Sep 28 16:49:19 2009, acferen@yahoo.com wrote: Show quoted text
> # r2672 introduces this particular failure. > > > S:\poe\trunk\poe>prove -b t/30_loops/select/wheel_sf_ipv6.t > t/30_loops/select/wheel_sf_ipv6....# This test may hang if your > firewall > blocks IPv6 > # packets across your localhost interface. > getsockname() on unopened socket GEN0 at > blib\lib/POE/Wheel/SocketFactory.pm line 425. > Use of uninitialized value in subroutine entry at > C:\Perl\site\lib\POE\Test\Loops/wheel_sf_ipv6.pm line 72. > t/30_loops/select/wheel_sf_ipv6....ok 1/3Bad arg length for > Socket6::unpack_sockaddr_in6, length is 0, should be 28 at > C:\Perl\site\lib\POE\Test\Loops/wheel_sf_ipv6.pm line 72. > Compilation failed in require at t/30_loops/select/wheel_sf_ipv6.t > line 20. > # Looks like you planned 3 tests but ran 1. > # Looks like your test exited with 2 just after 1. > t/30_loops/select/wheel_sf_ipv6....dubious > Test returned status 2 (wstat 512, 0x200) > DIED. FAILED tests 2-3 > Failed 2/3 tests, 33.33% okay (less 1 skipped test: 0 okay, > 0.00%) > Failed Test Stat Wstat Total Fail List of > Failed >
------------------------------------------------------------------------------- Show quoted text
> t/30_loops/select/wheel_sf_ipv6.t 2 512 3 4 2-3 > 1 subtest skipped. > Failed 1/1 test scripts. 2/3 subtests failed. > Files=1, Tests=3, 2 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00 > CPU) > Failed 1/1 test programs. 2/3 subtests failed.
Actually, it's working here. Do you have IPv6 enabled, and IPv6 routing enabled on your firewall?
On Thu Oct 01 02:21:51 2009, RCAPUTO wrote: Show quoted text
> Actually, it's working here. Do you have IPv6 enabled, and IPv6 routing > enabled on your firewall?
On closer inspection ipv6 is not installed. Previously the test had not passed, but failed more gracefully. The issue is that when the new Started event fires things die and the test no longer exits gracefully. attached is a patch to get the test to fail gracefully by skipping all the expected tests. To test on Win32 XP "ipv6 install" and "ipv6 uninstall" to install/uninstall the IPv6 stack. Unfortunately at least with ActiveState Socket6 will install/load with out error even if the IPv6 stack isn't there. I didn't see an obvious way to deal with this directly.
Index: lib/POE/Test/Loops/wheel_sf_ipv6.pm =================================================================== --- lib/POE/Test/Loops/wheel_sf_ipv6.pm (revision 2706) +++ lib/POE/Test/Loops/wheel_sf_ipv6.pm (working copy) @@ -69,9 +69,17 @@ Error => \&server_got_error, ClientError => sub { }, # Hush a warning. Started => sub { - $tcp_server_port = ( - Socket6::unpack_sockaddr_in6($_[HEAP]->{listener}->getsockname()) - )[0]; + eval { + my $socketname= $_[HEAP]->{listener}->getsockname(); + $tcp_server_port = (Socket6::unpack_sockaddr_in6($socketname))[0]; + }; + if (!$tcp_server_port || $@) { + $tcp_server_port = undef; + SKIP: { + my $errstr = $@ || 'server port undefined'; + skip "AF_INET6 probably not supported/configured ($errstr)", 2 + } + } }, ); @@ -111,17 +119,19 @@ ############################################################################### # Start the TCP client. -POE::Component::Client::TCP->new( - RemoteAddress => '::1', - RemotePort => $tcp_server_port, - Domain => Socket6::AF_INET6, - BindAddress => '::1', - Connected => \&client_got_connect, - ServerInput => \&client_got_input, - ServerFlushed => \&client_got_flush, - Disconnected => \&client_got_disconnect, - ConnectError => \&client_got_connect_error, -); +if ($tcp_server_port) { + POE::Component::Client::TCP->new( + RemoteAddress => '::1', + RemotePort => $tcp_server_port, + Domain => Socket6::AF_INET6, + BindAddress => '::1', + Connected => \&client_got_connect, + ServerInput => \&client_got_input, + ServerFlushed => \&client_got_flush, + Disconnected => \&client_got_disconnect, + ConnectError => \&client_got_connect_error, + ); +} sub client_got_connect { my $heap = $_[HEAP];
Patch applied as revision 2707, but I was reading the wrong ticket during the commit and attributed the wrong person. Sorry, Andrew.