Skip to content

Commit b04cec1

Browse files
authored
Deflake CI (#1751)
* `complexity_test`: deflake, same as #272 As it can be seen in e.g. https://github.com/google/benchmark/actions/runs/7711328637/job/21016492361 We may get `65: BM_Complexity_O1_BigO 0.00 N^2 0.00 N^2 ` * `user_counters_tabular_test`: deflake We were still getting zero times there. Perhaps this is better?
1 parent e990563 commit b04cec1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/complexity_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const char *enum_big_o_1 = "\\([0-9]+\\)";
8888
// FIXME: Tolerate both '(1)' and 'lgN' as output when the complexity is auto
8989
// deduced.
9090
// See https://github.com/google/benchmark/issues/272
91-
const char *auto_big_o_1 = "(\\([0-9]+\\))|(lgN)";
91+
const char *auto_big_o_1 = "(\\([0-9]+\\))|(lgN)|(N\\^2)";
9292
const char *lambda_big_o_1 = "f\\(N\\)";
9393

9494
// Add enum tests

test/user_counters_tabular_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ CHECK_BENCHMARK_RESULTS("BM_Counters_Tabular/repeats:2/threads:2$",
372372
void BM_CounterRates_Tabular(benchmark::State& state) {
373373
for (auto _ : state) {
374374
// This test requires a non-zero CPU time to avoid divide-by-zero
375-
auto iterations = state.iterations();
375+
auto iterations = double(state.iterations()) * double(state.iterations());
376376
benchmark::DoNotOptimize(iterations);
377377
}
378378
namespace bm = benchmark;

0 commit comments

Comments
 (0)