734417
From 49bc120dcaeb68e2a870e7d92cf3f217e3487fe5 Mon Sep 17 00:00:00 2001
734417
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
734417
Date: Thu, 2 Jul 2015 11:15:28 +0200
734417
Subject: [PATCH] Benchmark.t: remove CPU-speed-sensitive test
734417
MIME-Version: 1.0
734417
Content-Type: text/plain; charset=UTF-8
734417
Content-Transfer-Encoding: 8bit
734417
734417
This is upstream commit ported to 5.16.3:
734417
734417
commit 9eba9e102c2f8c2ec41a50f4bbe6b09a64dddd31
734417
Author: David Mitchell <davem@iabyn.com>
734417
Date:   Fri Jul 19 23:10:50 2013 +0100
734417
734417
    Benchmark.t: remove CPU-speed-sensitive test
734417
734417
    Benchmark.t has been randomly failing test 15 in smokes for ages.
734417
    This is the one that checks that a loop run 3*N times burns approximately
734417
    3 times more CPU than when run just N times.
734417
734417
    For the last month the test has included a calibration loop and test,
734417
    which does much the same thing, but without using any code from
734417
    Benchmark.pm. This has failed just as much, which confirms that its an
734417
    issue with the smoke host (such as a variable speed CPU or whatever),
734417
    rather than any flaw in the Benchmark.pm library logic.
734417
734417
    So just remove the calibration loop and the dodgy test.
734417
734417
Signed-off-by: Petr Písař <ppisar@redhat.com>
734417
---
734417
 lib/Benchmark.t | 19 +------------------
734417
 1 file changed, 1 insertion(+), 18 deletions(-)
734417
734417
diff --git a/lib/Benchmark.t b/lib/Benchmark.t
734417
index 004092e..62bc1a6 100644
734417
--- a/lib/Benchmark.t
734417
+++ b/lib/Benchmark.t
734417
@@ -8,7 +8,7 @@ BEGIN {
734417
 use warnings;
734417
 use strict;
734417
 use vars qw($foo $bar $baz $ballast);
734417
-use Test::More tests => 196;
734417
+use Test::More tests => 195;
734417
 
734417
 use Benchmark qw(:all);
734417
 
734417
@@ -86,23 +86,6 @@ my $in_onesec_adj = $in_onesec;
734417
 $in_onesec_adj *= (1/$cpu1); # adjust because may not have run for exactly 1s
734417
 print "# in_onesec_adj=$in_onesec_adj adjusted iterations\n";
734417
 
734417
-{
734417
-  my $difference = $in_onesec_adj - $estimate;
734417
-  my $actual = abs ($difference / $in_onesec_adj);
734417
-  cmp_ok($actual, '<=', $delta, "is $in_onesec_adj within $delta of estimate ($estimate)")
734417
-    or do {
734417
-	diag("  in_threesecs     = $in_threesecs");
734417
-	diag("  in_threesecs_adj = $in_threesecs_adj");
734417
-	diag("  cpu3             = $cpu3");
734417
-	diag("  sys3             = $sys3");
734417
-	diag("  estimate         = $estimate");
734417
-	diag("  in_onesec        = $in_onesec");
734417
-	diag("  in_onesec_adj    = $in_onesec_adj");
734417
-	diag("  cpu1             = $cpu1");
734417
-	diag("  sys1             = $sys1");
734417
-    };
734417
-}
734417
-
734417
 # I found that the eval'ed version was 3 times faster than the coderef.
734417
 # (now it has a different ballast value)
734417
 $baz = 0;
734417
-- 
734417
2.4.3
734417