Skip to content

Commit

Permalink
metric expired test
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos committed Dec 25, 2024
1 parent be4fba0 commit 71dbece
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/metric/tests/test_metric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1964,9 +1964,12 @@ TEST_CASE("test metric manager clean expired label") {
CHECK(c->label_value_count() == 2);
CHECK(summary->label_value_count() == 1);
CHECK(h->label_value_count() == 1);
std::this_thread::sleep_for(std::chrono::seconds(2));
std::this_thread::sleep_for(std::chrono::seconds(3));
c->inc({"/index"});
size_t count = c->label_value_count();
if (count != 1) {
std::this_thread::sleep_for(std::chrono::seconds(2));
}
CHECK(count == 1);
auto ct1 = summary->label_value_count();
CHECK(ct1 == 0);
Expand Down

0 comments on commit 71dbece

Please sign in to comment.