[Bps-public-commit] r9766 - in Test-HTTP-Server-Simple: .

alexmv at bestpractical.com alexmv at bestpractical.com
Fri Nov 30 13:59:44 EST 2007


Author: alexmv
Date: Fri Nov 30 13:59:44 2007
New Revision: 9766

Modified:
   Test-HTTP-Server-Simple/   (props changed)
   Test-HTTP-Server-Simple/lib/Test/HTTP/Server/Simple.pm

Log:
 r25264 at zoq-fot-pik:  chmrr | 2007-11-30 13:59:36 -0500
  * Sometimes the USR1 signal doesn't get to the server (!?), so we
    alarm and try again every 5 seconds.


Modified: Test-HTTP-Server-Simple/lib/Test/HTTP/Server/Simple.pm
==============================================================================
--- Test-HTTP-Server-Simple/lib/Test/HTTP/Server/Simple.pm	(original)
+++ Test-HTTP-Server-Simple/lib/Test/HTTP/Server/Simple.pm	Fri Nov 30 13:59:44 2007
@@ -82,8 +82,17 @@
         }
     }
     else {
-        kill 'USR1', @CHILD_PIDS if @CHILD_PIDS;
-        1 while $_ = wait and $_ > 0;
+        my $done = not @CHILD_PIDS;
+        while (not $done) {
+            kill 'USR1', @CHILD_PIDS;
+            local $SIG{ALRM} = sub {die};
+            alarm(5);
+            eval {
+                1 while $_ = wait and $_ > 0;
+            };
+            alarm(0);
+            $done = not $@;
+        }
     }
 } 
 



More information about the Bps-public-commit mailing list