[Rt-commit] rt branch, 4.4/avoid-hanging-apache-tests, created. rt-4.4.2-232-g03a78a5df

? sunnavy sunnavy at bestpractical.com
Mon May 7 08:28:01 EDT 2018


The branch, 4.4/avoid-hanging-apache-tests has been created
        at  03a78a5dfc1493719ccfdffc3ebb8f8fe5e2ea92 (commit)

- Log -----------------------------------------------------------------
commit 03a78a5dfc1493719ccfdffc3ebb8f8fe5e2ea92
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon May 7 20:20:48 2018 +0800

    Don't endlessly try to terminate apache processes in tests
    
    It's more important to not hang the tests

diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index de713d2fe..3334fb580 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -1695,7 +1695,15 @@ sub stop_server {
     kill 'TERM', @SERVERS;
     foreach my $pid (@SERVERS) {
         if ($ENV{RT_TEST_WEB_HANDLER} =~ /^apache/) {
-            sleep 1 while kill 0, $pid;
+            my $count = 0;
+            while ( kill 0, $pid ) {
+                sleep 1;
+                last if $count++ >= 100;
+            }
+
+            # Give it a final shot and leave it.
+            # It's more important to not hang the tests
+            kill 'KILL', $pid if kill 0, $pid;
         } else {
             waitpid $pid, 0;
         }

-----------------------------------------------------------------------


More information about the rt-commit mailing list