From 48e4e842b79a0fe26ee9044830110f9a3484c20a Mon Sep 17 00:00:00 2001 From: yiwu-arbug Date: Wed, 19 Oct 2016 18:18:42 -0700 Subject: [PATCH] Disable auto compactions in memory_test and re-enable the test (#1408) Summary: Auto-compactions will change memory usage of DB but memory_test didn't take it into account. This PR disable auto compactions in the test and hopefully it fixes its flakyness. Test Plan: UBSAN build used to catch the flakyness. Run `make ubsan_check` and it passes. --- utilities/memory/memory_test.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utilities/memory/memory_test.cc b/utilities/memory/memory_test.cc index 5c97f78bd..69202521a 100644 --- a/utilities/memory/memory_test.cc +++ b/utilities/memory/memory_test.cc @@ -93,7 +93,7 @@ class MemoryTest : public testing::Test { std::vector usage_history_[MemoryUtil::kNumUsageTypes]; }; -TEST_F(MemoryTest, DISABLED_SharedBlockCacheTotal) { +TEST_F(MemoryTest, SharedBlockCacheTotal) { std::vector dbs; std::vector usage_by_type; const int kNumDBs = 10; @@ -104,6 +104,7 @@ TEST_F(MemoryTest, DISABLED_SharedBlockCacheTotal) { opt.write_buffer_size = kKeySize + kValueSize; opt.max_write_buffer_number = 10; opt.min_write_buffer_number_to_merge = 10; + opt.disable_auto_compactions = true; BlockBasedTableOptions bbt_opts; bbt_opts.block_cache = NewLRUCache(4096 * 1000 * 10); for (int i = 0; i < kNumDBs; ++i) { @@ -144,7 +145,7 @@ TEST_F(MemoryTest, DISABLED_SharedBlockCacheTotal) { } } -TEST_F(MemoryTest, DISABLED_MemTableAndTableReadersTotal) { +TEST_F(MemoryTest, MemTableAndTableReadersTotal) { std::vector dbs; std::vector usage_by_type; std::vector> vec_handles; @@ -157,6 +158,7 @@ TEST_F(MemoryTest, DISABLED_MemTableAndTableReadersTotal) { opt.write_buffer_size = kKeySize + kValueSize; opt.max_write_buffer_number = 10; opt.min_write_buffer_number_to_merge = 10; + opt.disable_auto_compactions = true; std::vector cf_descs = { {kDefaultColumnFamilyName, ColumnFamilyOptions(opt)},