develooper Front page | perl.perl5.porters | Postings from March 2012

Hanging tests

Thread Next
From:
Steve Hay
Date:
March 28, 2012 08:09
Subject:
Hanging tests
Message ID:
1B32FF956ABF414C9BCE5E487A1497E70CD6CC09@ukmail02.planit.group
I find that several tests keep hanging when I run the full test suite
"manually" (i.e. typing "nmake test" in a Command Prompt), the first of
which is cpan/CPANPLUS/t/19_CPANPLUS-Dist.t. Strangely, they don't hang
if I redirect STDOUT and STDERR to a file, e.g. "nmake test >out.txt
2>&1", which probably explains why they never hang when running a smoke
either.

They also never hang when I run the tests in question individually,
either as "perl harness /path/to/test" or as "nmake test
TEST_FILES=/path/to/test", which makes no sense to me and is not making
it easy to find what's going on...

However, with some extra debug prints inserted, I've found that the test
cited above hangs after emitting an "ok 43" and before emitting anything
for test 44. It's in the test for "Perl binary version too low" and it's
this line in CPANPLUS::Dist::_resolve_prereqs() which hangs:

my $ok = run( command => "$^X -M$version -e1", verbose => 1 );

That's IPC::Cmd::run() there, and on Windows it winds up in
IPC::Open3::spawn_with_handles(). It reaches nearly the end of the
function, where it calls ->close() on each IO::Handle in %saved, and
that just calls CORE::close() on the filehandle (I think). It hangs in
the case where it is closing the handle for file descriptor 2 (STDERR).

What would cause close() on the STDERR filehandle to hang in this way?

At first I wondered if the problem was introduced by the bunch of
changes made to IPC::Open3 on 11 June 2011, but I get the same problem
with 5.14.0 which doesn't have those changes. I don't recall seeing this
problem in the past, so maybe it's a result of upgrading my PC (new
hardware, new OS, but same compiler), and yet I don't see this problem
with 5.12.4, so it can't be just down to this PC. I also tried 5.14.0
with IPC::Cmd and IPC::Open3 reverted to the versions in 5.12.4 but the
tests still hang, so it can't be just down to those two modules either.


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About