This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
more reliably kill a runaway test process on cygwin
authorTony Cook <tony@develop-help.com>
Fri, 2 Dec 2011 12:23:00 +0000 (23:23 +1100)
committerTony Cook <tony@develop-help.com>
Sat, 3 Dec 2011 02:04:28 +0000 (13:04 +1100)
Sometimes a plain kill isn't enough.

Along with the previous change this reliably kills a blocked
t/op/threads.t on cygwin as needed.

This doesn't attempt to fix the underlying bug (which may be in
Win32, cygwin or perl itself)

t/test.pl

index a664720..66d6e07 100644 (file)
--- a/t/test.pl
+++ b/t/test.pl
@@ -1329,6 +1329,11 @@ sub watchdog ($;$)
             if (kill(0, $pid_to_kill)) {
                 _diag($timeout_msg);
                 kill('KILL', $pid_to_kill);
+               if ($is_cygwin) {
+                   # sometimes the above isn't enough on cygwin
+                   sleep 1; # wait a little, it might have worked after all
+                   system("/bin/kill -f $pid_to_kill");
+               }
             }
 
             # Don't execute END block (added at beginning of this file)