diff options
author | Todd Rinaldo <toddr@cpanel.net> | 2010-02-02 09:27:37 -0800 |
---|---|---|
committer | Jesse Vincent <jesse@bestpractical.com> | 2010-02-02 09:27:37 -0800 |
commit | 8350df422c2af17dc86ea17dcbbe151cbc8fe6d9 (patch) | |
tree | 07c5a8cf4538bcd6b6913def99086c1847132ca2 /lib | |
parent | eeb92b76fda504cc34bcd98ba2dbc73d933c0208 (diff) | |
download | perl-8350df422c2af17dc86ea17dcbbe151cbc8fe6d9.tar.gz |
Diagnostic improvements to better understand why lib/Benchark.t test 13 has been failing smoke randomly.
Fix 1: Original code tests for less than but not =. I think that if these values are the same, the test should pass. I don't know the code well enough to be 100% sure. D
Fix 2: convert ok() to cmp_ok() for better diagnostic messages from smoke tests when they happen.
Fix 3: convert print to diag() so it will properly print through harness.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Benchmark.t | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Benchmark.t b/lib/Benchmark.t index 3a7a1def85..9b8e2af1d9 100644 --- a/lib/Benchmark.t +++ b/lib/Benchmark.t @@ -77,9 +77,8 @@ ok ($in_onesec > 0, "iters returned positive iterations"); { my $difference = $in_onesec - $estimate; my $actual = abs ($difference / $in_onesec); - ok ($actual < $delta, "is $in_onesec within $delta of estimate ($estimate)"); - print "# $in_onesec is between " . ($delta / 2) . - " and $delta of estimate. Not that safe.\n" if $actual > $delta/2; + cmp_ok($actual, '<=', $delta, "is $in_onesec within $delta of estimate ($estimate)") + or diag("# $in_onesec is between " . ($delta / 2) . " and $delta of estimate. Not that safe."); } # I found that the eval'ed version was 3 times faster than the coderef. |