This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
If a unit test doesn't finish in 5 minutes, it's not a unit test.
authorJarkko Hietaniemi <jhi@iki.fi>
Fri, 14 Oct 2016 02:04:20 +0000 (22:04 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 15 Oct 2016 00:25:15 +0000 (20:25 -0400)
These tests seem to often be outliers in execution time.  In faster
modern machines the slowness is not noticeable, but in slower machines
these are excruciatingly slow.

In slow machines these tests may grind for hours, but that is not
that useful information.  We know the machine is slow, already.

The uniprops.t could also use the watchdog, except that TestProp.pl
seems to be purposefully avoiding using test.pl.

t/re/fold_grind.t
t/re/pat_psycho.t
t/re/uniprops.t

index 6358165..bf5c9fd 100644 (file)
@@ -11,6 +11,7 @@ BEGIN {
     if ($^O eq 'dec_osf') {
       skip_all("$^O cannot handle this test");
     }
+    watchdog(5 * 60);
     require './loc_tools.pl';
 }
 
index c0f855f..e136c12 100644 (file)
@@ -24,6 +24,7 @@ BEGIN {
     if ($^O eq 'dec_osf') {
         skip_all("$^O cannot handle this test");
     }
+    watchdog(5 * 60);
 }
 
 
index f53a9c2..5214c41 100644 (file)
@@ -3,10 +3,14 @@ use warnings;
 no warnings 'once';
 
 if ($^O eq 'dec_osf') {
-   print "1..0 # $^O cannot handle this test\n";
-   exit(0);
+    print "1..0 # $^O cannot handle this test\n";
+    exit(0);
 }
 
+# TODO: it would be good to have watchdog(5 * 60) in here
+# for slow machines, but unfortunately we cannot trivially
+# use test.pl because the TestProp.pl avoids using that.
+
 # This is a wrapper for a generated file.  Assumes being run from 't'
 # directory.