Author: tim.bunce
Date: Wed Jan  7 04:06:52 2009
New Revision: 667

Modified:
    trunk/t/20.runtests.t

Log:
Be more generous with time limits when running automated tests
(to fix failures like  
http://www.nntp.perl.org/group/perl.cpan.testers/2009/01/msg3010800.html)


Modified: trunk/t/20.runtests.t
==============================================================================
--- trunk/t/20.runtests.t       (original)
+++ trunk/t/20.runtests.t       Wed Jan  7 04:06:52 2009
@@ -295,6 +295,11 @@
          }
      }

+    # if it was slower than expected then we're very generous, to allow for
+    # slow systems, e.g. cpan-testers running in cpu-starved virtual  
machines.
+    my $max_time_overrun_percentage = ($ENV{AUTOMATED_TESTING}) ? 300 :  
200;
+    my $max_time_underrun_percentage = 95;
+
      my @accuracy_errors;
      $index = 0;
      my $limit = scalar(@got) - 1;
@@ -318,14 +323,9 @@

              # Test aproximate times
              push @accuracy_errors,
-                "$test line $index: got $t0 expected approx $expected for  
time ($percent%)"
-
-                # if it was faster than expected then it should only be  
slightly faster
-                if ($percent < 95)
-
-                # if it was slower than expected then we're much more  
generous, to allow for
-                # slow systems, e.g. cpan-testers running in cpu-starved  
virtual machines.
-                or ($percent > 200);
+                  "$test line $index: got $t0 expected approx $expected  
for time ($percent%)"
+                if ($percent < $max_time_underrun_percentage)
+                or ($percent > $max_time_overrun_percentage);

              my $tc = $t0 / $c0;
              push @accuracy_errors, "$test line $index: got $tc0 expected  
~$tc for time/calls"

--~--~---------~--~----~------------~-------~--~----~
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.

Group hosted at:  http://groups.google.com/group/develnytprof-dev
Project hosted at:  http://perl-devel-nytprof.googlecode.com
CPAN distribution:  http://search.cpan.org/dist/Devel-NYTProf

To post, email:  [email protected]
To unsubscribe, email:  [email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to