From 5535d06b9c6b24f46132377d08eb59ed8136ddc8 Mon Sep 17 00:00:00 2001 From: sherriiiliu <79488180+sherriiiliu@users.noreply.github.com> Date: Mon, 19 Jul 2021 10:33:59 -0700 Subject: [PATCH] Fix stats_history_test failure on Windows (#8520) Summary: Fixed a stats_history_test failure on Windows * In StatsHistoryTest.InMemoryStatsHistoryPurging test, the capping memory cost of stats_history_size on Windows increases to 15000 bytes with latest changes Pull Request resolved: https://github.com/facebook/rocksdb/pull/8520 Reviewed By: ajkr Differential Revision: D29734631 Pulled By: mrambacher fbshipit-source-id: 461698fcf22ef06acfb7f7aa86f8415aaffe7f1e --- monitoring/stats_history_test.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/monitoring/stats_history_test.cc b/monitoring/stats_history_test.cc index c1a2ad989..187bf6e9d 100644 --- a/monitoring/stats_history_test.cc +++ b/monitoring/stats_history_test.cc @@ -245,10 +245,10 @@ TEST_F(StatsHistoryTest, InMemoryStatsHistoryPurging) { } size_t stats_history_size = dbfull()->TEST_EstimateInMemoryStatsHistorySize(); ASSERT_GE(slice_count, kIterations - 1); - ASSERT_GE(stats_history_size, 14000); - // capping memory cost at 14000 bytes since one slice is around 10000~14000 - ASSERT_OK(dbfull()->SetDBOptions({{"stats_history_buffer_size", "14000"}})); - ASSERT_EQ(14000, dbfull()->GetDBOptions().stats_history_buffer_size); + ASSERT_GE(stats_history_size, 15000); + // capping memory cost at 15000 bytes since one slice is around 10000~15000 + ASSERT_OK(dbfull()->SetDBOptions({{"stats_history_buffer_size", "15000"}})); + ASSERT_EQ(15000, dbfull()->GetDBOptions().stats_history_buffer_size); // Wait for stats persist to finish for (int i = 0; i < kIterations; ++i) { @@ -270,7 +270,7 @@ TEST_F(StatsHistoryTest, InMemoryStatsHistoryPurging) { dbfull()->TEST_EstimateInMemoryStatsHistorySize(); // only one slice can fit under the new stats_history_buffer_size ASSERT_LT(slice_count, 2); - ASSERT_TRUE(stats_history_size_reopen < 13000 && + ASSERT_TRUE(stats_history_size_reopen < 15000 && stats_history_size_reopen > 0); ASSERT_TRUE(stats_count_reopen < stats_count && stats_count_reopen > 0); Close();