# If we could be running more tests, don't wait so we can schedule a new
# one immediately. If all runners are busy, wait a fraction of a second
# for one to finish so we can still loop around to check the abort flag.
- my $runnerwait = scalar(@runnersidle) && scalar(@runtests) ? 0 : 1.0;
+ my $runnerwait = scalar(@runnersidle) && scalar(@runtests) ? 0.1 : 1.0;
my (@ridsready, $riderror) = runnerar_ready($runnerwait);
if(@ridsready) {
for my $ridready (@ridsready) {
undef $ridready;
}
if($ridready) {
+ $endwaitcnt = 0;
# This runner is ready to be serviced
my $testnum = $runnersrunning{$ridready};
defined $testnum || die "Internal error: test for runner $ridready unknown";
delete $runnersrunning{$riderror} if(defined $runnersrunning{$riderror});
$globalabort = 1;
}
- if(!scalar(@runtests) && ++$endwaitcnt == (240 + $jobs)) {
+ $endwaitcnt += $runnerwait;
+ if($endwaitcnt >= 10) {
# Once all tests have been scheduled on a runner at the end of a test
# run, we just wait for their results to come in. If we're still
# waiting after a couple of minutes ($endwaitcnt multiplied by
# likely point to a single test that has hung.
logmsg "Hmmm, the tests are taking a while to finish. Here is the status:\n";
catch_usr1();
+ $endwaitcnt = 0;
}
}