What am I doing wrong?

This code starts to work but hangs (and always times out if a timeout is specified).

sub auto :Private {
    eval { require IPC::Cmd;
           require File::Find::Rule;
       };
}
sub index :Path :Args(0) {
    my ( $self, $c ) = @_;
    my @tests = File::Find::Rule->file()
                     ->name( '*.t' )
                     ->in( $c->path_to("t") );

    # Messing with this doesn't seem to help...?
    local $SIG{CHLD} = "DEFAULT";

    my $prove = IPC::Cmd::can_run("prove");

    # Just run 01app.t in $test[0] for the sake of testing this.

    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
IPC::Cmd::run( command => [ $prove, "-I" . $c->path_to ("lib"), $tests[0] ],
                       timeout => 15,
                       verbose => 0 );

    $c->response->content_type("text/plain");
    $c->response->body( join"\n", @{$full_buf} );
#    $c->response->body( join"\n", @tests );
}


After it times out, this appears in the test server output in the terminal:

.../t/01app......ok
All tests successful.
Files=1, Tests=2, 23 wallclock secs ( 0.02 usr 0.01 sys + 3.78 cusr 0.57 csys = 4.38 CPU)
Result: PASS

Why is it hanging? Is there a pipe or something I could add to the command? What are the environmental caveats if I can get this to run under the test server v fastcgi/modperl?

Thanks for looking!

-Ashley


_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to