On 2016-10-27 14:46:19, OLEG wrote:
Show quoted text> Чтв Окт 27 14:22:49 2016, SREZIC писал:
> > On a few of my smokers the test suite fails:
> >
> > ...
> > Can't locate object method "new" via package "IO::Socket::IP"
> > (perhaps
> > you forgot to load "IO::Socket::IP"?) at t/03_connect.t line 177.
> > # Tests were run but no plan was declared and done_testing() was not
> > seen.
> > # Looks like your test exited with 255 just after 19.
> > ...
>
> This is very strange. On line 177 class for new method getted via
> $SOCKET_CLASS variable from IO::Socket::Socks namespace:
>
https://metacpan.org/source/OLEG/IO-Socket-Socks-
> 0.71/t/03_connect.t#L177
> And if this variable equals IO::Socket::IP this means that
> IO::Socket::IP loaded successfully:
>
https://metacpan.org/source/OLEG/IO-Socket-Socks-
> 0.71/lib/IO/Socket/Socks.pm#L24
> Can you debug a little why this happens? I can't replicate it here.
The test fails only for two perls on my smokers: freebsd9.2 with perl 5.14.4 and debian/jessie with perl 5.14.4. Both have IO::Socket::IP installed with these versions:
* freebsd9.2: 0.37
* linux: 0.38
I added some debugging statements into the test:
--- a/t/03_connect.t
+++ b/t/03_connect.t
@@ -174,6 +174,10 @@ if (ok($sock, "socks object created from plain socket")) {
is(fileno($sock), fileno($unconnected_sock), "socks object uses plain socket");
}
+warn $IO::Socket::Socks::SOCKET_CLASS;
+warn join("\n", map { "$_ => $INC{$_}" } sort keys %INC);
+warn defined &IO::Socket::IP::new;
+use Data::Dumper; $Data::Dumper::Deparse=1; warn Dumper(\&IO::Socket::IP::new);
$sock = $IO::Socket::Socks::SOCKET_CLASS->new(PeerAddr => $s_host, PeerPort => $s_port);
if (ok($sock, "$IO::Socket::Socks::SOCKET_CLASS socket created")) {
$sock = IO::Socket::Socks->start_SOCKS($sock, ConnectAddr => $h_host, ConnectPort => $h_port);
And it seems that IO::Socket::IP is really loaded:
...
ok 18 - socks object created from plain socket
ok 19 - socks object uses plain socket
IO::Socket::IP at t/03_connect.t line 177.
...
IO/Socket.pm => /opt/perl-5.14.4/lib/5.14.4/x86_64-linux/IO/Socket.pm
IO/Socket/INET.pm => /opt/perl-5.14.4/lib/5.14.4/x86_64-linux/IO/Socket/INET.pm
IO/Socket/IP.pm => /opt/perl-5.14.4/lib/site_perl/5.14.4/IO/Socket/IP.pm
IO/Socket/Socks.pm => /tmpfs/.cpan-build-cpansand/2016102718/IO-Socket-Socks-0.71-0/blib/lib/IO/Socket/Socks.pm
IO/Socket/UNIX.pm => /opt/perl-5.14.4/lib/5.14.4/x86_64-linux/IO/Socket/UNIX.pm
...
1 at t/03_connect.t line 179.
$VAR1 = sub {
package IO::Socket::IP;
use warnings;
use strict 'refs';
my $class = shift();
my(%arg) = @_ == 1 ? ('PeerHost', $_[0]) : @_;
return $class->SUPER::new(%arg);
};
Can't locate object method "new" via package "IO::Socket::IP" (perhaps you forgot to load "IO::Socket::IP"?) at t/03_connect.t line 181.
Very strange...