]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Increase ChargeTableReaderTest/ChargeTableReaderTest.Basic error tolerance rate from...
authorHui Xiao <huixiao@fb.com>
Sat, 4 Jun 2022 02:42:22 +0000 (19:42 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Sat, 4 Jun 2022 02:42:22 +0000 (19:42 -0700)
Summary:
**Context:**
https://github.com/facebook/rocksdb/pull/9748 added support to charge table reader memory to block cache. In the test `ChargeTableReaderTest/ChargeTableReaderTest.Basic`, it estimated the table reader memory, calculated the expected number of table reader opened based on this estimation and asserted this number with actual number. The expected number of table reader opened calculated based on estimated table reader memory will not be 100% accurate and should have tolerance for error. It was previously set to 1% and recently encountered an assertion failure that `(opened_table_reader_num) <= (max_table_reader_num_capped_upper_bound), actual: 375 or 376 vs 374` where `opened_table_reader_num` is the actual opened one and `max_table_reader_num_capped_upper_bound` is the estimated opened one (=371 * 1.01). I believe it's safe to increase error tolerance from 1% to 5% hence there is this PR.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/10113

Test Plan: - CI again succeeds.

Reviewed By: ajkr

Differential Revision: D36911556

Pulled By: hx235

fbshipit-source-id: 259687dd77b450fea0f5658a5b567a1d31d4b1f7

table/block_based/block_based_table_reader_test.cc

index 4c2844f53b1620daa54b6a21d00b3874a9319f18..1f70d7a6435e934adeee39c3d2ef0468d375c473 100644 (file)
@@ -406,9 +406,9 @@ TEST_P(ChargeTableReaderTest, Basic) {
   // 2. overestimate/underestimate max_table_reader_num_capped due to the gap
   // between ApproximateTableReaderMem() and actual table reader mem
   std::size_t max_table_reader_num_capped_upper_bound =
-      (std::size_t)(max_table_reader_num_capped * 1.01);
+      (std::size_t)(max_table_reader_num_capped * 1.05);
   std::size_t max_table_reader_num_capped_lower_bound =
-      (std::size_t)(max_table_reader_num_capped * 0.99);
+      (std::size_t)(max_table_reader_num_capped * 0.95);
   std::size_t max_table_reader_num_uncapped =
       (std::size_t)(max_table_reader_num_capped * 1.1);
   ASSERT_GT(max_table_reader_num_uncapped,