Change 34344 by [EMAIL PROTECTED] on 2008/09/11 14:36:19

        Integrate:
        [ 34341]
        Integrate:
        [ 34315]
        Make sure temp file has an extension on VMS to work with the new
        temp file name generator in t/test.pl
        
        [ 34316]
        Make sure the watchdog requeues itself when sleep() wakes up early
        (such as when an alarm fires).  Also, bail out with SIGTERM rather
        than SIGKILL on VMS since the latter kills the shell from which
        Perl was started.
        
        [ 34328]
        Subject: [PATCH] Fix parallel testing temp filenames
        From: "Jerry D. Hedden" <[EMAIL PROTECTED]>
        Message-ID: <[EMAIL PROTECTED]>
        Date: Tue, 9 Sep 2008 11:52:45 -0400
        
        [ 34337]
        Subject: [PATCH] Watchdog re-queue
        From: "Jerry D. Hedden" <[EMAIL PROTECTED]>
        Message-ID: <[EMAIL PROTECTED]>
        Date: Tue, 9 Sep 2008 09:54:41 -0400

Affected files ...

... //depot/maint-5.8/perl/lib/charnames.t#11 integrate
... //depot/maint-5.8/perl/lib/strict.t#6 integrate
... //depot/maint-5.8/perl/lib/subs.t#3 integrate
... //depot/maint-5.8/perl/t/comp/multiline.t#4 integrate
... //depot/maint-5.8/perl/t/test.pl#25 integrate

Differences ...

==== //depot/maint-5.8/perl/lib/charnames.t#11 (text) ====
Index: perl/lib/charnames.t
--- perl/lib/charnames.t#10~30495~      2007-03-07 08:11:42.000000000 -0800
+++ perl/lib/charnames.t        2008-09-11 07:36:19.000000000 -0700
@@ -271,10 +271,9 @@
 
 # ---- Alias extensions
 
-my $tmpfile = "tmp0000";
+my $tmpfile = tempfile();
 my $alifile = File::Spec->catfile(File::Spec->updir, qw(lib unicore 
xyzzy_alias.pl));
 my $i = 0;
-1 while -e ++$tmpfile;
 END { if ($tmpfile) { 1 while unlink $tmpfile; } }
 
 my @prgs;

==== //depot/maint-5.8/perl/lib/strict.t#6 (text) ====
Index: perl/lib/strict.t
--- perl/lib/strict.t#5~30723~  2007-03-23 08:27:22.000000000 -0700
+++ perl/lib/strict.t   2008-09-11 07:36:19.000000000 -0700
@@ -4,6 +4,7 @@
     chdir 't' if -d 't';
     @INC = '../lib';
     $ENV{PERL5LIB} = '../lib';
+    require './test.pl';
 }
 
 $| = 1;
@@ -11,9 +12,8 @@
 my $Is_VMS = $^O eq 'VMS';
 my $Is_MSWin32 = $^O eq 'MSWin32';
 my $Is_NetWare = $^O eq 'NetWare';
-my $tmpfile = "tmp0000";
+my $tmpfile = tempfile();
 my $i = 0 ;
-1 while -e ++$tmpfile;
 END { if ($tmpfile) { 1 while unlink $tmpfile; } }
 
 my @prgs = () ;
@@ -78,7 +78,7 @@
     my $status = $?;
     $results =~ s/\n+$//;
     # allow expected output to be written as if $prog is on STDIN
-    $results =~ s/tmp\d+/-/g;
+    $results =~ s/tmp\d+[A-Z][A-Z]?/-/g;
     $results =~ s/\n%[A-Z]+-[SIWEF]-.*$// if $Is_VMS;  # clip off DCL status 
msg
     $expected =~ s/\n+$//;
     $expected =~ s|(\./)?abc\.pm|:abc.pm|g if $^O eq 'MacOS';

==== //depot/maint-5.8/perl/lib/subs.t#3 (text) ====
Index: perl/lib/subs.t
--- perl/lib/subs.t#2~22089~    2004-01-07 05:19:41.000000000 -0800
+++ perl/lib/subs.t     2008-09-11 07:36:19.000000000 -0700
@@ -4,6 +4,7 @@
     chdir 't' if -d 't';
     @INC = '../lib';
     $ENV{PERL5LIB} = '../lib';
+    require './test.pl';
 }
 
 $| = 1;
@@ -15,9 +16,8 @@
 my $Is_MSWin32 = $^O eq 'MSWin32';
 my $Is_NetWare = $^O eq 'NetWare';
 my $Is_MacOS = $^O eq 'MacOS';
-my $tmpfile = "tmp0000";
+my $tmpfile = tempfile();
 my $i = 0 ;
-1 while -e ++$tmpfile;
 END {  if ($tmpfile) { 1 while unlink $tmpfile} }
 
 for (@prgs){
@@ -59,7 +59,7 @@
     my $status = $?;
     $results =~ s/\n+$//;
     # allow expected output to be written as if $prog is on STDIN
-    $results =~ s/tmp\d+/-/g;
+    $results =~ s/tmp\d+[A-Z][A-Z]?/-/g;
     $results =~ s/\n%[A-Z]+-[SIWEF]-.*$// if $Is_VMS;  # clip off DCL status 
msg
 # bison says 'parse error' instead of 'syntax error',
 # various yaccs may or may not capitalize 'syntax'.

==== //depot/maint-5.8/perl/t/comp/multiline.t#4 (xtext) ====
Index: perl/t/comp/multiline.t
--- perl/t/comp/multiline.t#3~34299~    2008-09-06 08:27:08.000000000 -0700
+++ perl/t/comp/multiline.t     2008-09-11 07:36:19.000000000 -0700
@@ -42,7 +42,8 @@
 is($count, 7,   '    line count');
 is($., 7,       '    $.' );
 
-$out = (($^O eq 'MSWin32') || $^O eq 'NetWare' || $^O eq 'VMS') ? `type 
$filename`
+$out = (($^O eq 'MSWin32') || $^O eq 'NetWare') ? `type $filename`
+    : ($^O eq 'VMS') ? `type $filename.;0`   # otherwise .LIS is assumed
     : ($^O eq 'MacOS') ? `catenate $filename`
     : `cat $filename`;
 

==== //depot/maint-5.8/perl/t/test.pl#25 (text) ====
Index: perl/t/test.pl
--- perl/t/test.pl#24~34277~    2008-09-05 09:34:16.000000000 -0700
+++ perl/t/test.pl      2008-09-11 07:36:19.000000000 -0700
@@ -843,10 +843,11 @@
                 local $SIG{'__WARN__'} = sub {
                     _diag("Watchdog warning: $_[0]");
                 };
+                my $sig = $^O eq 'VMS' ? 'TERM' : 'KILL';
                 $watchdog = system(1, which_perl(), '-e',
                                                     "sleep($timeout);" .
                                                     "warn('# 
$timeout_msg\n');" .
-                                                    "kill('KILL', 
$pid_to_kill);");
+                                                    "kill($sig, 
$pid_to_kill);");
             };
             if ($@ || ($watchdog <= 0)) {
                 _diag('Failed to start watchdog');
@@ -908,13 +909,17 @@
                 eval { require POSIX; };
 
                 # Execute the timeout
-                sleep($timeout);
+                my $time_left = $timeout;
+                do {
+                    $time_left -= sleep($time_left);
+                } while ($time_left > 0);
 
                 # Kill the parent (and ourself)
                 select(STDERR); $| = 1;
                 _diag($timeout_msg);
                 POSIX::_exit(1) if (defined(&POSIX::_exit));
-                kill('KILL', $pid_to_kill);
+                my $sig = $^O eq 'VMS' ? 'TERM' : 'KILL';
+                kill($sig, $pid_to_kill);
             })->detach();
         return;
     }
@@ -929,7 +934,8 @@
             select(STDERR); $| = 1;
             _diag($timeout_msg);
             POSIX::_exit(1) if (defined(&POSIX::_exit));
-            kill('KILL', $pid_to_kill);
+            my $sig = $^O eq 'VMS' ? 'TERM' : 'KILL';
+            kill($sig, $pid_to_kill);
         };
     }
 }
End of Patch.

Reply via email to