Disable two dynamic options tests under lite build

Summary: RocksDB lite don't support dynamic options. Disable the two test from lite build, and assert `SetOptions` should return `status::OK`.

Test Plan: Run the db_options test under lite build and normal build.

Reviewers: sdong

Reviewed By: sdong

Subscribers: andrewkr, dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D61119
main
Yi Wu 9 years ago
parent 2a6d0cde72
commit c6654588bd
  1. 12
      db/db_options_test.cc

@ -17,6 +17,9 @@ class DBOptionsTest : public DBTestBase {
DBOptionsTest() : DBTestBase("/db_options_test") {} DBOptionsTest() : DBTestBase("/db_options_test") {}
}; };
// RocksDB lite don't support dynamic options.
#ifndef ROCKSDB_LITE
// When write stalls, user can enable auto compaction to unblock writes. // When write stalls, user can enable auto compaction to unblock writes.
// However, we had an issue where the stalled write thread blocks the attempt // However, we had an issue where the stalled write thread blocks the attempt
// to persist auto compaction option, thus creating a deadlock. The test // to persist auto compaction option, thus creating a deadlock. The test
@ -52,7 +55,7 @@ TEST_F(DBOptionsTest, EnableAutoCompactionToUnblockWrites) {
ASSERT_TRUE(dbfull()->TEST_write_controler().IsStopped()); ASSERT_TRUE(dbfull()->TEST_write_controler().IsStopped());
ColumnFamilyHandle* handle = dbfull()->DefaultColumnFamily(); ColumnFamilyHandle* handle = dbfull()->DefaultColumnFamily();
// We will get a deadlock here if we hit the issue. // We will get a deadlock here if we hit the issue.
dbfull()->EnableAutoCompaction({handle}); ASSERT_OK(dbfull()->EnableAutoCompaction({handle}));
env_->WaitForJoin(); env_->WaitForJoin();
} }
@ -87,11 +90,14 @@ TEST_F(DBOptionsTest, ToggleStopTriggerToUnblockWrites) {
TEST_SYNC_POINT("DBOptionsTest::ToggleStopTriggerToUnblockWrites:1"); TEST_SYNC_POINT("DBOptionsTest::ToggleStopTriggerToUnblockWrites:1");
ASSERT_TRUE(dbfull()->TEST_write_controler().IsStopped()); ASSERT_TRUE(dbfull()->TEST_write_controler().IsStopped());
// We will get a deadlock here if we hit the issue. // We will get a deadlock here if we hit the issue.
dbfull()->SetOptions({{"level0_stop_writes_trigger", "1000000"}, ASSERT_OK(
{"level0_slowdown_writes_trigger", "1000000"}}); dbfull()->SetOptions({{"level0_stop_writes_trigger", "1000000"},
{"level0_slowdown_writes_trigger", "1000000"}}));
env_->WaitForJoin(); env_->WaitForJoin();
} }
#endif // ROCKSDB_LITE
} // namespace rocksdb } // namespace rocksdb
int main(int argc, char** argv) { int main(int argc, char** argv) {

Loading…
Cancel
Save