Subject: | forked processes from test scripts cause hang |
I've come across an issue with running some tests that use Inline::Java. Occasionally, Inline::
Java will fail to start within its 15 second timeout period, and because it's run at compile
time, the test script will exit with no tests having run. But, behind the scenes, Inline::Java
actually started succesfully.
The problem is that because the java process spawned by Inline::Java is still running, it's still
got stdin/stdout/stderr open. So the prove that is running the test never sees an EOF. To
the user, it merely appears that the tests have hung after an error message.
I have distilled this down to a small example, without Inline::Java:
#!perl
use strict;
use warnings;
use Test::More 'no_plan';
BEGIN { fork && exec "sleep 3600" }
die "bang";
I realise that this is a somewhat rare occurrence, but I was wondering if it would make sense
for Test::Harness to pay attention to SIGCHLD? In this case, the prove process does receive a
SIGCHLD when the process it spawned exits, but it ignores it and continues trying to read
from the pipe (which is now only attached to the grandchild process).
This is all running under perl 5.8.8 and Test-Harness-2.63_02.
Many thanks,
-Dom