提交 5535d06b 编写于 作者: S sherriiiliu 提交者: Facebook GitHub Bot

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
上级 d5f3b77f
......@@ -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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册