Skip to content

Commit

Permalink
Deflake CI (#1751)
Browse files Browse the repository at this point in the history
* `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?
  • Loading branch information
LebedevRI committed Feb 2, 2024
1 parent e990563 commit b04cec1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/complexity_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const char *enum_big_o_1 = "\\([0-9]+\\)";
// FIXME: Tolerate both '(1)' and 'lgN' as output when the complexity is auto
// deduced.
// See https://github.com/google/benchmark/issues/272
const char *auto_big_o_1 = "(\\([0-9]+\\))|(lgN)";
const char *auto_big_o_1 = "(\\([0-9]+\\))|(lgN)|(N\\^2)";
const char *lambda_big_o_1 = "f\\(N\\)";

// Add enum tests
Expand Down
2 changes: 1 addition & 1 deletion test/user_counters_tabular_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ CHECK_BENCHMARK_RESULTS("BM_Counters_Tabular/repeats:2/threads:2$",
void BM_CounterRates_Tabular(benchmark::State& state) {
for (auto _ : state) {
// This test requires a non-zero CPU time to avoid divide-by-zero
auto iterations = state.iterations();
auto iterations = double(state.iterations()) * double(state.iterations());
benchmark::DoNotOptimize(iterations);
}
namespace bm = benchmark;
Expand Down

0 comments on commit b04cec1

Please sign in to comment.