cURL / Mailing Lists / curl-library / Single Mail

curl-library

kill hung test processes

From: Guenter <lists_at_gknw.net>
Date: Tue, 08 Nov 2011 03:29:59 +0100

Since it happens every now and then that we get some hung tests, and
then with next test round tons of skipped tests due to stunnel already
running and other whoes, I searched a bit for a simple hung killer ...

diff --git a/tests/testcurl.pl b/tests/testcurl.pl
index 83a4261..3331312 100755
--- a/tests/testcurl.pl
+++ b/tests/testcurl.pl
@@ -72,8 +72,18 @@ use vars qw($name $email $desc $confopts $runtestopts
$setupfile $mktarball
              $extvercmd $nogitpull $nobuildconf $crosscompile
              $timestamp $notes);

+# Try to kill all hung processes which match the specified pattern
+# if we found the 'Proc::Killall' module installed.
+# http://search.cpan.org/~durist/Proc-ProcessTable/Killall.pm
+eval "require Proc::Killall";
+if (!$@) {
+ # SIGKILL to "curl|stunnel"
+ my $hungps=Proc::Killall::killall('KILL', 'curl|stunnel');
+ print "testcurl: $hungps processes killed.\n";
+}
+
  # version of this script
-$version='2011-06-23';
+$version='2011-11-08';
  $fixed=0;

  # Determine if we're running from git or a canned copy of curl,

if nobody objects I would like to commit this patch to testcurl.pl ...

comments?

Gün.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-11-08