This queue is for tickets about the Danga-Socket CPAN distribution.

Report information
The Basics
Id:
21751
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
NML [...] cpan.org
Requestors:
CHORNY [...] cpan.org
alexchorny [...] gmail.com
Cc:
AdminCc:

BugTracker
Severity:
Critical
Broken in:
  • 1.53
  • 1.61
Fixed in:
1.62



Subject: test hangs on MSWin32
ActiveState perl v5.8.7 built for MSWin32-x86-multi-thread Binary build 813 t/05-postloop.....ok 14/17Base class event_err called for Danga::Socket=ARRAY(0x1ade1b0) # Looks like you planned 17 tests but only ran 15. # Looks like your test died just after 15. t/05-postloop.....dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 16-17 Failed 2/17 tests, 88.24% okay t/10-events.......ok 1/34 hangs here. Same error on Vanilla Perl. ------- Alexandr Ciornii, http://chorny.net
From: Alexandr Ciornii <alexchorny@gmail.com>
Also hangs on 1.54.
I've traced this issue to not being able to set non-blocking sockets. E.g. 10/event.t has lines like this: IO::Handle::blocking($sock, 0); The tests can be made to fail instead of later hanging by just checking the return value, e.g.: IO::Handle::blocking($sock, 0) or die "Couldn't set nonblocking socket: $!"; Alternatively, there do seem to be some ways to do non-blocking sockets on Win32. See http://www.perlmonks.org/?node_id=529812
On Sun Mar 09 12:20:26 2008, DAGOLDEN wrote:
Show quoted text
> I've traced this issue to not being able to set non-blocking sockets. > > E.g. 10/event.t has lines like this: > > IO::Handle::blocking($sock, 0); > > The tests can be made to fail instead of later hanging by just checking > the return value, e.g.: > > IO::Handle::blocking($sock, 0) or die "Couldn't set nonblocking > socket: $!";
IO::Handle::blocking return previous status and undef in case of failure, so this check should be defined(IO::Handle::blocking($sock, 0)) || die (Couldn't set nonblocking socket: $!");
Show quoted text
> Alternatively, there do seem to be some ways to do non-blocking sockets > on Win32. See http://www.perlmonks.org/?node_id=529812
IO::Handle version 1.26 has such implementation, but setting it still fails (error is that this is not a socket). And tests hang on Strawberry 5.22.1 and 5.24.0RC3. -- Alexandr Ciornii, http://chorny.net
Here is a fix: https://github.com/apparentlymart/libdanga-socket-perl/pull/1/commits/7a25b203f8f9a30dce2b1d010eb3b7438b3e6461 Tests on Windows: https://ci.appveyor.com/project/nponeccFrom 7a25b203f8f9a30dce2b1d010eb3b7438b3e6461 Mon Sep 17 00:00:00 2001 From: Andrii Melnykov <andy.melnikov@gmail.com> Date: Wed, 27 Jun 2018 23:54:01 +0300 Subject: [PATCH] Fix tests blocking on Windows --- t/10-events.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/10-events.t b/t/10-events.t index 5ebf5b4..71ed4c5 100644 --- a/t/10-events.t +++ b/t/10-events.t @@ -69,9 +69,9 @@ sub new { LocalPort => $SERVER_PORT, Proto => 'tcp', ReuseAddr => 1, + Blocking => 0, ); die "couldn't create socket" unless $ssock; - IO::Handle::blocking($ssock, 0); my $self = $class->SUPER::new($ssock); $self->watch_read(1); return $self;op/libdanga-socket-perl/build/1.0.5 Tests on Linux (multiple perls): https://travis-ci.org/nponeccop/libdanga-socket-perl/builds/397531995 The diff is very small indeed:
RT-Send-CC: alexchorny@gmail.com
On Tue May 03 06:51:10 2016, CHORNY wrote:
Show quoted text
> On Sun Mar 09 12:20:26 2008, DAGOLDEN wrote: >
> > I've traced this issue to not being able to set non-blocking sockets. > > > > E.g. 10/event.t has lines like this: > > > > IO::Handle::blocking($sock, 0); > > > > The tests can be made to fail instead of later hanging by just > > checking > > the return value, e.g.: > > > > IO::Handle::blocking($sock, 0) or die "Couldn't set nonblocking > > socket: $!";
> > IO::Handle::blocking return previous status and undef in case of > failure, so this check should be > defined(IO::Handle::blocking($sock, 0)) || die (Couldn't set > nonblocking socket: $!"); >
> > Alternatively, there do seem to be some ways to do non-blocking > > sockets > > on Win32. See http://www.perlmonks.org/?node_id=529812
> > IO::Handle version 1.26 has such implementation, but setting it still > fails (error is that this is not a socket). And tests hang on > Strawberry 5.22.1 and 5.24.0RC3.
Can you test https://cpan.metacpan.org/authors/id/N/NM/NML/Danga-Socket-1.62_02-TRIAL.tar.gz to see if it's fixed? I got maintenance rights and will release 1.62 soon.


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.