CGI-Compile

 view release on metacpan or  search on metacpan

t/race-conditions.t  view on Meta::CPAN

my %children;

$SIG{CHLD} = sub {
    while ((my $child = waitpid(-1, WNOHANG)) > 0) {
        delete $children{$child};

        ok($? >> 8 == 0, "no race condition in child PID=$child");
    }
};

# 400 iterations when smoking, 25 otherwise.
for (1..($ENV{AUTOMATED_TESTING} ? 400 : 25)) {
    my $errors = capture_stderr {
        # Use 8 simultaneous processes when smoking, 2 otherwise.
        for (1..($ENV{AUTOMATED_TESTING} ? 8 : 2)) {
            defined(my $child = fork()) or die "fork() failed: $!";

            if ($child == 0) { # child
                try {
                    my $sub = CGI::Compile->compile("t/hello.cgi");



( run in 0.796 second using v1.01-cache-2.11-cpan-96521ef73a4 )