Skip to content

Commit

Permalink
Deflake perf context test (#382)
Browse files Browse the repository at this point in the history
 

Signed-off-by: Yang Zhang <[email protected]>

Co-authored-by: Changyu Bi <[email protected]>
  • Loading branch information
v01dstar and cbi42 authored Sep 27, 2024
1 parent ab9a886 commit 2ba7241
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions db/perf_context_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -943,15 +943,17 @@ TEST_F(PerfContextTest, CPUTimer) {

// monotonically increasing
get_perf_context()->Reset();
auto count = get_perf_context()->iter_seek_cpu_nanos;
uint64_t count = get_perf_context()->iter_seek_cpu_nanos;
uint64_t before_count = count;
for (int i = 0; i < FLAGS_total_keys; ++i) {
iter->Seek("k" + std::to_string(i));
ASSERT_TRUE(iter->Valid());
ASSERT_EQ("v" + std::to_string(i), iter->value().ToString());
auto next_count = get_perf_context()->iter_seek_cpu_nanos;
ASSERT_GT(next_count, count);
ASSERT_GE(next_count, count);
count = next_count;
}
ASSERT_GT(count, before_count);

// iterator creation/destruction; multiple iterators
{
Expand Down

0 comments on commit 2ba7241

Please sign in to comment.