#121395 fix, on Win32 test.pl watchdog always blocks for entire timeout
authorbulk88 <bulk88@hotmail.com>
Mon, 24 Mar 2014 01:01:15 +0000 (21:01 -0400)
committerSteve Hay <steve.m.hay@googlemail.com>
Mon, 24 Mar 2014 08:13:15 +0000 (08:13 +0000)
See Perl RT #121395 for details.

pod/perldelta.pod
t/test.pl

index 5906e78..358aea3 100644 (file)
@@ -309,6 +309,13 @@ L</Modules and Pragmata> section.
 
 XXX
 
+=item Win32
+
+About 15 minutes of idle sleeping was removed from running C<make test> due to
+a bug in which the timeout monitor used for tests could not be cancelled once
+the test completes, and the full timeout period elapsed before running the next
+test file.
+
 =back
 
 =head1 Internal Changes
index 15282ca..30db88c 100644 (file)
--- a/t/test.pl
+++ b/t/test.pl
@@ -1558,8 +1558,14 @@ sub watchdog ($;$)
 
             # Add END block to parent to terminate and
             #   clean up watchdog process
-            eval "END { local \$! = 0; local \$? = 0;
-                        wait() if kill('KILL', $watchdog); };";
+            # Win32 watchdog is launched by cmd.exe shell, so use process group
+            # kill, otherwise the watchdog is never killed and harness waits
+            # every time for the timeout, #121395
+            eval( $is_mswin ?
+            "END { local \$! = 0; local \$? = 0;
+                        wait() if kill('-KILL', $watchdog); };"
+            : "END { local \$! = 0; local \$? = 0;
+                        wait() if kill('KILL', $watchdog); };");
             return;
         }