runtests: show still running tests when nothing has happened for a while

... even if there are tests still pending. To help visualize tests that
might be hanging.

Attempts to set the limit at 10 seconds of silence.

Closes #18349
This commit is contained in:
Daniel Stenberg 2025-08-22 11:44:35 +02:00
parent a8d20cd223
commit b3570b36d7
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -3048,7 +3048,7 @@ while() {
# 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) {
@ -3061,6 +3061,7 @@ while() {
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";
@ -3145,7 +3146,8 @@ while() {
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
@ -3154,6 +3156,7 @@ while() {
# 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;
}
}