Skip to content

Commit d8fe7a5

Browse files
committed
Fix DBBlockCacheTest.ParanoidFileChecks
1 parent f8eabe0 commit d8fe7a5

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

db/db_block_cache_test.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ TEST_F(DBBlockCacheTest, IndexAndFilterBlocksCachePriority) {
471471
}
472472
}
473473

474+
// For this test, we DO want paranoid_file_checks WITHOUT fill_cache
474475
TEST_F(DBBlockCacheTest, ParanoidFileChecks) {
475476
Options options = CurrentOptions();
476477
options.create_if_missing = true;
@@ -487,7 +488,7 @@ TEST_F(DBBlockCacheTest, ParanoidFileChecks) {
487488
ASSERT_OK(Put(1, "9_key", "val"));
488489
// Create a new table.
489490
ASSERT_OK(Flush(1));
490-
ASSERT_EQ(1, /* read and cache data block */
491+
ASSERT_EQ(0, /* flush will not cache data block */
491492
TestGetTickerCount(options, BLOCK_CACHE_ADD));
492493

493494
ASSERT_OK(Put(1, "1_key2", "val2"));
@@ -496,7 +497,7 @@ TEST_F(DBBlockCacheTest, ParanoidFileChecks) {
496497
// and generate another file.
497498
ASSERT_OK(Flush(1));
498499
dbfull()->TEST_WaitForCompact();
499-
ASSERT_EQ(3, /* Totally 3 files created up to now */
500+
ASSERT_EQ(0, /* flush or compaction will not cache data block */
500501
TestGetTickerCount(options, BLOCK_CACHE_ADD));
501502

502503
// After disabling options.paranoid_file_checks. NO further block
@@ -511,7 +512,7 @@ TEST_F(DBBlockCacheTest, ParanoidFileChecks) {
511512
ASSERT_OK(Put(1, "9_key4", "val4"));
512513
ASSERT_OK(Flush(1));
513514
dbfull()->TEST_WaitForCompact();
514-
ASSERT_EQ(3, /* Totally 3 files created up to now */
515+
ASSERT_EQ(0, /* flush or compaction will not cache data block */
515516
TestGetTickerCount(options, BLOCK_CACHE_ADD));
516517
}
517518

0 commit comments

Comments
 (0)