tets: testrunner fairness
Collect all ready runners from select() and process in a loop. This assures fairness in processing among all runners. Formerly, only the first ready runner in the list of all was processed, leading to later runners being delayed in processing and reporting overly long test durations. Also, reduce the backend idle timeout for the h2/h3 test servers so that process shutdowns take less time. Closes #14967
This commit is contained in:
parent
8498b1b953
commit
9413949397
@ -108,6 +108,7 @@ $certfile = abs_path($certfile);
|
|||||||
$keyfile = abs_path($keyfile);
|
$keyfile = abs_path($keyfile);
|
||||||
|
|
||||||
my $cmdline="$nghttpx --backend=$connect ".
|
my $cmdline="$nghttpx --backend=$connect ".
|
||||||
|
"--backend-keep-alive-timeout=500ms ".
|
||||||
"--frontend=\"*,$listenport;no-tls\" ".
|
"--frontend=\"*,$listenport;no-tls\" ".
|
||||||
"--frontend=\"*,$listenport2\" ".
|
"--frontend=\"*,$listenport2\" ".
|
||||||
"--log-level=INFO ".
|
"--log-level=INFO ".
|
||||||
|
|||||||
@ -108,6 +108,7 @@ $certfile = abs_path($certfile);
|
|||||||
$keyfile = abs_path($keyfile);
|
$keyfile = abs_path($keyfile);
|
||||||
|
|
||||||
my $cmdline="$nghttpx --http2-proxy --backend=$connect ".
|
my $cmdline="$nghttpx --http2-proxy --backend=$connect ".
|
||||||
|
"--backend-keep-alive-timeout=500ms ".
|
||||||
"--frontend=\"*,$listenport\" ".
|
"--frontend=\"*,$listenport\" ".
|
||||||
"--frontend=\"*,$listenport;quic\" ".
|
"--frontend=\"*,$listenport;quic\" ".
|
||||||
"--log-level=INFO ".
|
"--log-level=INFO ".
|
||||||
|
|||||||
@ -1361,6 +1361,7 @@ sub runnerar_ready {
|
|||||||
my $rin = "";
|
my $rin = "";
|
||||||
my %idbyfileno;
|
my %idbyfileno;
|
||||||
my $maxfileno=0;
|
my $maxfileno=0;
|
||||||
|
my @ready_runners = ();
|
||||||
foreach my $p (keys(%controllerr)) {
|
foreach my $p (keys(%controllerr)) {
|
||||||
my $fd = fileno($controllerr{$p});
|
my $fd = fileno($controllerr{$p});
|
||||||
vec($rin, $fd, 1) = 1;
|
vec($rin, $fd, 1) = 1;
|
||||||
@ -1383,10 +1384,11 @@ sub runnerar_ready {
|
|||||||
return (undef, $idbyfileno{$fd});
|
return (undef, $idbyfileno{$fd});
|
||||||
}
|
}
|
||||||
if(vec($rout, $fd, 1)) {
|
if(vec($rout, $fd, 1)) {
|
||||||
return ($idbyfileno{$fd}, undef);
|
push(@ready_runners, $idbyfileno{$fd});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
die "Internal pipe readiness inconsistency\n";
|
die "Internal pipe readiness inconsistency\n" if(!@ready_runners);
|
||||||
|
return (@ready_runners, undef);
|
||||||
}
|
}
|
||||||
return (undef, undef);
|
return (undef, undef);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2945,7 +2945,9 @@ while () {
|
|||||||
# one immediately. If all runners are busy, wait a fraction of a second
|
# 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.
|
# 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.0;
|
||||||
my ($ridready, $riderror) = runnerar_ready($runnerwait);
|
my (@ridsready, $riderror) = runnerar_ready($runnerwait);
|
||||||
|
if(@ridsready) {
|
||||||
|
for my $ridready (@ridsready) {
|
||||||
if($ridready && ! defined $runnersrunning{$ridready}) {
|
if($ridready && ! defined $runnersrunning{$ridready}) {
|
||||||
# On Linux, a closed pipe still shows up as ready instead of error.
|
# On Linux, a closed pipe still shows up as ready instead of error.
|
||||||
# Detect this here by seeing if we are expecting it to be ready and
|
# Detect this here by seeing if we are expecting it to be ready and
|
||||||
@ -3001,7 +3003,9 @@ while () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!$ridready && $runnerwait && !$torture && scalar(%runnersrunning)) {
|
}
|
||||||
|
}
|
||||||
|
if(!@ridsready && $runnerwait && !$torture && scalar(%runnersrunning)) {
|
||||||
$runner_wait_cnt++;
|
$runner_wait_cnt++;
|
||||||
if($runner_wait_cnt >= 5) {
|
if($runner_wait_cnt >= 5) {
|
||||||
my $msg = "waiting for " . scalar(%runnersrunning) . " results:";
|
my $msg = "waiting for " . scalar(%runnersrunning) . " results:";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user