From: Ben Pfaff Date: Tue, 23 Nov 2004 00:36:46 +0000 (+0000) Subject: Fix treatment of timeouts in run-tests and pintos. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=538e0cc1951cc2edf253918fd83fc3c36d9a6398;p=pintos-anon Fix treatment of timeouts in run-tests and pintos. --- diff --git a/grading/vm/run-tests b/grading/vm/run-tests index 85164aa..61adbaf 100755 --- a/grading/vm/run-tests +++ b/grading/vm/run-tests @@ -696,8 +696,15 @@ sub xsystem { }; if ($@) { die unless $@ eq "alarm\n"; # propagate unexpected errors - print "Timed out $pid.\n"; - kill ('SIGTERM', $pid); + print "Timed out: "; + for (my ($i) = 0; $i < 10; $i++) { + kill ('SIGTERM', $pid); + sleep (1); + my ($retval) = waitpid ($pid, WNOHANG); + last if $retval == $pid || $retval == -1; + print "Waiting for $pid to die" if $i == 0; + print "."; + } $status = 0; }