]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: better handle ^C during slow tests
authorDan Fandrich <dan@coneharvesters.com>
Wed, 14 Jun 2023 22:18:36 +0000 (15:18 -0700)
committerDan Fandrich <dan@coneharvesters.com>
Tue, 20 Jun 2023 00:14:27 +0000 (17:14 -0700)
Since the SIGINT handler now just sets a flag that must be checked in the
main controller loop, make sure that runs periodically.  Rather than
blocking on a response from a test runner near the end of the test run,
add a short timeout to allow it.

tests/runtests.pl

index b1d894d72063c610366fc8a1130a35d0379851dc..83933bd7b1cf2f9cbedaa7e7e70e77fa2fd65cf3 100755 (executable)
@@ -2775,10 +2775,10 @@ while () {
     }
 
     # See if a test runner needs attention
-    # If we could be running more tests, wait just a moment so we can schedule
-    # a new one shortly. If all runners are busy, wait indefinitely for one to
-    # finish.
-    my $runnerwait = scalar(@runnersidle) && scalar(@runtests) ? 0 : undef;
+    # 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 : 0.5;
     my $ridready = runnerar_ready($runnerwait);
     if($ridready) {
         # This runner is ready to be serviced