Skip Menu |
 

This queue is for tickets about the autodie CPAN distribution.

Report information
The Basics
Id: 74795
Status: resolved
Priority: 0/
Queue: autodie

People
Owner: Nobody in particular
Requestors: TODDR [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.10
Fixed in: 2.11



Subject: recv.t test 5-6 fail if STDIN is closed.
Download (untitled) / with headers
text/plain 214b
Hi, while running test suites for blead on centos 5 through an automated system. I encountered a bug with autodie. t/recv.t assumes STDIN is opened in test 5-6. I'm attaching a patch to skip if STDIN is closed.
Subject: recv.patch.txt
Download recv.patch.txt
text/plain 932b
commit d17ed11380d4e2501141c48195453f99722e67b4 Author: Todd Rinaldo <toddr@cpan.org> Date: Wed Feb 8 15:34:58 2012 -0600 blead cpan autodie recv.t breaks when STDIN is closed diff --git a/SOURCES/perl/cpan/autodie/t/recv.t b/SOURCES/perl/cpan/autodie/t/recv.t index cfaa679..45a1093 100644 --- a/SOURCES/perl/cpan/autodie/t/recv.t +++ b/SOURCES/perl/cpan/autodie/t/recv.t @@ -37,13 +37,18 @@ SKIP: { } -eval { - # STDIN isn't a socket, so this should fail. - recv(STDIN,$buffer,1,0); -}; +SKIP: { + skip("cannot test recv on STDIN when it's closed", 2) + unless( STDIN->opened ); -ok($@,'recv dies on returning undef'); -isa_ok($@,'autodie::exception'); + eval { + # STDIN isn't a socket, so this should fail. + recv(STDIN,$buffer,1,0); + }; + + ok($@,'recv dies on returning undef'); + isa_ok($@,'autodie::exception'); +} $buffer = "# Not an empty string\n";
ran tests via make test_harness_notty
Download (untitled) / with headers
text/plain 312b
I think I spoke to soon. Actually STDIN is open in this failing test. but recv does not die. looking at buffer, nothing is in it that I can tell. and $buffer is not a ref. This is happening on centos 5 both 32/64 bit distro versions. The test with exactly the same conditions does not happen on centos 6 32/64
Download (untitled) / with headers
text/plain 257b
I think I'll have a fix tomorrow. I'm waiting for some test results. I think the problem I'm having is because STDIN is a socket in my test. I worked with p5p this afternoon and have determine a way to determine this and skip as a result. More tomorrow.
Download (untitled) / with headers
text/plain 263b
I've confirmed the problem is that STDIN was a socket in my case. The simple fix is not to use STDIN. I instead am providing a patch that just opens the perl binary for read. I think this should work on all platforms. https://github.com/pfenwick/autodie/pull/8
That fix didn't work in blead. Let's try this one: https://github.com/pfenwick/autodie/pull/9
Download (untitled) / with headers
text/plain 242b
On Thu Feb 09 02:07:11 2012, TODDR wrote: Show quoted text
> That fix didn't work in blead. Let's try this one: > > https://github.com/pfenwick/autodie/pull/9
Hi, Looks like this was merged into the v2.11 release, so marking this bug as resolved. ~Niels


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

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