On 2018-04-09 11:00, Jim Jagielski wrote:
Anyone else seeing issues w/ the Perl test framework's ab test...

t/ab/base.t ..
1..5
# Running under perl version 5.020003 for darwin
# Current time local: Mon Apr  9 11:59:20 2018
# Current time GMT:   Mon Apr  9 15:59:20 2018
# Using Test.pm version 1.26
# Using Apache/Test.pm version 1.41
# # running:
# /usr/local2/apache2/bin/ab -q -n 10 http://localhost:8529/
not ok 1
not ok 2
# # running:
# /usr/local2/apache2/bin/ab -q -n 10 https://localhost:8532/
# Failed test 1 in t/ab/base.t at line 33
# Failed test 2 in t/ab/base.t at line 34
not ok 3
# Failed test 3 in t/ab/base.t at line 39
not ok 4
# Test 4 got: "4" (t/ab/base.t at line 40)
#   Expected: "0" (https had stderr output:$VAR1 = [
#          '
#',
#          'Test aborted after 10 failures
#',
#          '
#',
#          'apr_socket_connect(): Connection refused (61)
#'
#        ];
#)
ok 5
Failed 4/5 subtests


I just recently added this test to start getting coverage on ab. It uses IPC::Open3 which is a potential hiccup. Would you mind running this script like so: `perl ./script.pl`?

use strict;
use IPC::Open3;
use Symbol;

my $results = run_and_gather_output("echo 'Hello there'");
print "Result was " . join("", @{$results->{stdout}}) . "\n";

sub run_and_gather_output {
    my $command = shift;
    my ($cin, $cout, $cerr);
    $cerr = gensym();
    my $pid = open3($cin, $cout, $cerr, $command);
    waitpid( $pid, 0 );
    my $status = $? >> 8;
    my @cstdout = <$cout>;
    my @cstderr = <$cerr>;
return { status => $status, stdout => \@cstdout, stderr => \@cstderr };
}


Depending on if/where this fails, it should point out why your machine may be having problems (I don't have a way to test this on macOS). I *DID* see some strange behavior on my Linux box in that open3 munged both STDERR and STDOUT into a single stream... which is very unexpected.

--
Daniel Ruggeri

Reply via email to