From 98757f880f6a36624280f2a32f8774bccc45272e Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Sun, 7 Jan 2024 01:59:58 +0300 Subject: [PATCH] tools/compare: don't actually discard valid (but zero) `pvalue` So, this is embarressing. For a very large number of repetitions, we can end up with pvalue of a true zero, and it obviously compares false, and we treat it as-if we failed to compute it... --- tools/gbench/report.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/gbench/report.py b/tools/gbench/report.py index b6f7c3bf9a..7158fd1654 100644 --- a/tools/gbench/report.py +++ b/tools/gbench/report.py @@ -315,7 +315,7 @@ def get_difference_report(json1, json2, utest=False): have_optimal_repetitions, cpu_pvalue, time_pvalue = calc_utest( timings_cpu, timings_time ) - if cpu_pvalue and time_pvalue: + if cpu_pvalue is not None and time_pvalue is not None: utest_results = { "have_optimal_repetitions": have_optimal_repetitions, "cpu_pvalue": cpu_pvalue, @@ -1518,7 +1518,6 @@ def load_results(): json1, json2 = load_results() cls.json_diff_report = get_difference_report(json1, json2, utest=True) - @unittest.expectedFailure def test_json_diff_report_pretty_printing(self): expect_line = [ "BM_ManyRepetitions_pvalue", @@ -1543,7 +1542,6 @@ def test_json_diff_report_pretty_printing(self): break self.assertTrue(found) - @unittest.expectedFailure def test_json_diff_report(self): expected_output = [ {