From 62ba5c80343e5ab097415f709f92043309c86d6e Mon Sep 17 00:00:00 2001 From: Jay Zhuang Date: Mon, 10 Oct 2022 12:34:25 -0700 Subject: [PATCH] Deflake DBBloomFilterTest.OptimizeFiltersForHits (#10792) Summary: The test may fail because the L5 files may only cover small portion of the whole key range. Pull Request resolved: https://github.com/facebook/rocksdb/pull/10792 Test Plan: ``` gtest-parallel ./db_bloom_filter_test --gtest_filter=DBBloomFilterTest.OptimizeFiltersForHits -r 1000 -w 100 ``` Reviewed By: siying Differential Revision: D40217600 Pulled By: siying fbshipit-source-id: 18db549184bccf5e513eaa7e31ab17385b71ef71 --- db/db_bloom_filter_test.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/db_bloom_filter_test.cc b/db/db_bloom_filter_test.cc index 48bcaa254..9725a5843 100644 --- a/db/db_bloom_filter_test.cc +++ b/db/db_bloom_filter_test.cc @@ -2528,7 +2528,9 @@ TEST_F(DBBloomFilterTest, OptimizeFiltersForHits) { // Now we have three sorted run, L0, L5 and L6 with most files in L6 have // no bloom filter. Most keys be checked bloom filters twice. - ASSERT_GT(TestGetTickerCount(options, BLOOM_FILTER_USEFUL), 65000 * 2); + // But L5 SSTs may only cover small range of keys, so only L0 filter is + // guaranteed to be hit (USEFUL). + ASSERT_GE(TestGetTickerCount(options, BLOOM_FILTER_USEFUL), 100000); ASSERT_LT(TestGetTickerCount(options, BLOOM_FILTER_USEFUL), 120000 * 2); uint64_t bloom_filter_useful_all_levels = 0; for (auto& kv : (*(get_perf_context()->level_to_perf_context))) {