Skip to content

Commit

Permalink
reset counter
Browse files Browse the repository at this point in the history
  • Loading branch information
eldenmoon committed Feb 27, 2025
1 parent 64e703a commit 5c58b22
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions be/test/olap/tablet_column_object_pool_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ extern bvar::Adder<int64_t> g_tablet_index_cache_hit_count;
class TabletColumnObjectPoolTest : public testing::Test {
protected:
void SetUp() override {
_pool = std::make_unique<TabletColumnObjectPool>(1024); // Create pool with 1024 capacity
// reset all counters to 0
g_tablet_column_cache_count.reset();
g_tablet_column_cache_hit_count.reset();
g_tablet_index_cache_count.reset();
g_tablet_index_cache_hit_count.reset();

_pool = std::make_unique<TabletColumnObjectPool>(1024);
}

// Helper function to create a column PB
Expand Down Expand Up @@ -148,7 +154,6 @@ TEST_F(TabletColumnObjectPoolTest, TestDestructor) {

temp_pool.release(handle);
} // temp_pool destructor should be called here

// Verify counter was decremented
ASSERT_EQ(g_tablet_column_cache_count.get_value(), 0);
}
Expand Down

0 comments on commit 5c58b22

Please sign in to comment.