OpenForReadOnly is not supported in LITE mode (#6523)

Summary:
In DBLogicalBlockSizeCacheTest, do not test OpenForReadOnly in LITE mode.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6523

Test Plan: watch test for LITE mode

Differential Revision: D20420321

Pulled By: cheng-chang

fbshipit-source-id: e45bf6f2800206d6f8ce9af7308e76a08de80643
main
Cheng Chang 5 years ago committed by Facebook GitHub Bot
parent 0772768d07
commit 0d2c8e47e8
  1. 16
      db/db_logical_block_size_cache_test.cc

@ -74,8 +74,12 @@ TEST_F(DBLogicalBlockSizeCacheTest, OpenClose) {
printf("Open\n"); printf("Open\n");
ASSERT_OK(DB::Open(options, dbname_, &db)); ASSERT_OK(DB::Open(options, dbname_, &db));
} else { } else {
#ifdef ROCKSDB_LITE
break;
#else
printf("OpenForReadOnly\n"); printf("OpenForReadOnly\n");
ASSERT_OK(DB::OpenForReadOnly(options, dbname_, &db)); ASSERT_OK(DB::OpenForReadOnly(options, dbname_, &db));
#endif
} }
ASSERT_EQ(2, cache_->Size()); ASSERT_EQ(2, cache_->Size());
ASSERT_TRUE(cache_->Contains(data_path_0_)); ASSERT_TRUE(cache_->Contains(data_path_0_));
@ -101,8 +105,12 @@ TEST_F(DBLogicalBlockSizeCacheTest, OpenDelete) {
printf("Open\n"); printf("Open\n");
ASSERT_OK(DB::Open(options, dbname_, &db)); ASSERT_OK(DB::Open(options, dbname_, &db));
} else { } else {
#ifdef ROCKSDB_LITE
break;
#else
printf("OpenForReadOnly\n"); printf("OpenForReadOnly\n");
ASSERT_OK(DB::OpenForReadOnly(options, dbname_, &db)); ASSERT_OK(DB::OpenForReadOnly(options, dbname_, &db));
#endif
} }
ASSERT_EQ(1, cache_->Size()); ASSERT_EQ(1, cache_->Size());
ASSERT_TRUE(cache_->Contains(dbname_)); ASSERT_TRUE(cache_->Contains(dbname_));
@ -243,12 +251,16 @@ TEST_F(DBLogicalBlockSizeCacheTest, OpenWithColumnFamilies) {
{"default", ColumnFamilyOptions()}}, {"default", ColumnFamilyOptions()}},
&cfs, &db)); &cfs, &db));
} else { } else {
#ifdef ROCKSDB_LITE
break;
#else
printf("OpenForReadOnly\n"); printf("OpenForReadOnly\n");
ASSERT_OK(DB::OpenForReadOnly(options, dbname_, ASSERT_OK(DB::OpenForReadOnly(options, dbname_,
{{"cf1", cf_options}, {{"cf1", cf_options},
{"cf2", cf_options}, {"cf2", cf_options},
{"default", ColumnFamilyOptions()}}, {"default", ColumnFamilyOptions()}},
&cfs, &db)); &cfs, &db));
#endif
} }
// Logical block sizes of dbname_ and cf_path_0_ are cached during Open. // Logical block sizes of dbname_ and cf_path_0_ are cached during Open.
@ -336,10 +348,14 @@ TEST_F(DBLogicalBlockSizeCacheTest, DestroyColumnFamilyHandle) {
options, dbname_, options, dbname_,
{{"cf", cf_options}, {"default", ColumnFamilyOptions()}}, &cfs, &db)); {{"cf", cf_options}, {"default", ColumnFamilyOptions()}}, &cfs, &db));
} else { } else {
#ifdef ROCKSDB_LITE
break;
#else
printf("OpenForReadOnly\n"); printf("OpenForReadOnly\n");
ASSERT_OK(DB::OpenForReadOnly( ASSERT_OK(DB::OpenForReadOnly(
options, dbname_, options, dbname_,
{{"cf", cf_options}, {"default", ColumnFamilyOptions()}}, &cfs, &db)); {{"cf", cf_options}, {"default", ColumnFamilyOptions()}}, &cfs, &db));
#endif
} }
// cf_path_0_ and dbname_ are cached. // cf_path_0_ and dbname_ are cached.
ASSERT_EQ(2, cache_->Size()); ASSERT_EQ(2, cache_->Size());

Loading…
Cancel
Save