column_family_test: disable some tests in LITE

Summary: Some tests in column_family_test depend on functions that are not available in LITE build, which sometimes cause flakiness. Disable them.

Test Plan: Run those tests in LITE build.

Reviewers: yiwu, IslamAbdelRahman

Reviewed By: IslamAbdelRahman

Subscribers: leveldb, andrewkr, dhruba

Differential Revision: https://reviews.facebook.net/D65271
This commit is contained in:
sdong 2016-10-19 15:15:22 -07:00
parent 5af651db24
commit fb2e412943

View File

@ -280,29 +280,23 @@ class ColumnFamilyTest : public testing::Test {
} }
} }
#ifndef ROCKSDB_LITE // TEST functions in DB are not supported in lite
void WaitForFlush(int cf) { void WaitForFlush(int cf) {
#ifndef ROCKSDB_LITE // TEST functions are not supported in lite
ASSERT_OK(dbfull()->TEST_WaitForFlushMemTable(handles_[cf])); ASSERT_OK(dbfull()->TEST_WaitForFlushMemTable(handles_[cf]));
#endif // !ROCKSDB_LITE
} }
void WaitForCompaction() { void WaitForCompaction() {
#ifndef ROCKSDB_LITE // TEST functions are not supported in lite
ASSERT_OK(dbfull()->TEST_WaitForCompact()); ASSERT_OK(dbfull()->TEST_WaitForCompact());
#endif // !ROCKSDB_LITE
} }
uint64_t MaxTotalInMemoryState() { uint64_t MaxTotalInMemoryState() {
#ifndef ROCKSDB_LITE
return dbfull()->TEST_MaxTotalInMemoryState(); return dbfull()->TEST_MaxTotalInMemoryState();
#else
return 0;
#endif // !ROCKSDB_LITE
} }
void AssertMaxTotalInMemoryState(uint64_t value) { void AssertMaxTotalInMemoryState(uint64_t value) {
ASSERT_EQ(value, MaxTotalInMemoryState()); ASSERT_EQ(value, MaxTotalInMemoryState());
} }
#endif // !ROCKSDB_LITE
Status Put(int cf, const std::string& key, const std::string& value) { Status Put(int cf, const std::string& key, const std::string& value) {
return db_->Put(WriteOptions(), handles_[cf], Slice(key), Slice(value)); return db_->Put(WriteOptions(), handles_[cf], Slice(key), Slice(value));
@ -798,6 +792,7 @@ TEST_F(ColumnFamilyTest, IgnoreRecoveredLog) {
} }
} }
#ifndef ROCKSDB_LITE // TEST functions used are not supported
TEST_F(ColumnFamilyTest, FlushTest) { TEST_F(ColumnFamilyTest, FlushTest) {
Open(); Open();
CreateColumnFamiliesAndReopen({"one", "two"}); CreateColumnFamiliesAndReopen({"one", "two"});
@ -912,6 +907,7 @@ TEST_F(ColumnFamilyTest, LogDeletionTest) {
AssertCountLiveLogFiles(4); AssertCountLiveLogFiles(4);
Close(); Close();
} }
#endif // !ROCKSDB_LITE
TEST_F(ColumnFamilyTest, CrashAfterFlush) { TEST_F(ColumnFamilyTest, CrashAfterFlush) {
std::unique_ptr<FaultInjectionTestEnv> fault_env( std::unique_ptr<FaultInjectionTestEnv> fault_env(
@ -945,6 +941,7 @@ TEST_F(ColumnFamilyTest, CrashAfterFlush) {
db_options_.env = env_; db_options_.env = env_;
} }
#ifndef ROCKSDB_LITE // WaitForFlush() is not supported
// Makes sure that obsolete log files get deleted // Makes sure that obsolete log files get deleted
TEST_F(ColumnFamilyTest, DifferentWriteBufferSizes) { TEST_F(ColumnFamilyTest, DifferentWriteBufferSizes) {
// disable flushing stale column families // disable flushing stale column families
@ -1049,6 +1046,7 @@ TEST_F(ColumnFamilyTest, DifferentWriteBufferSizes) {
AssertCountLiveLogFiles(7); AssertCountLiveLogFiles(7);
Close(); Close();
} }
#endif // !ROCKSDB_LITE
#ifndef ROCKSDB_LITE // Cuckoo is not supported in lite #ifndef ROCKSDB_LITE // Cuckoo is not supported in lite
TEST_F(ColumnFamilyTest, MemtableNotSupportSnapshot) { TEST_F(ColumnFamilyTest, MemtableNotSupportSnapshot) {
@ -1136,6 +1134,7 @@ TEST_F(ColumnFamilyTest, DifferentMergeOperators) {
Close(); Close();
} }
#ifndef ROCKSDB_LITE // WaitForFlush() is not supported
TEST_F(ColumnFamilyTest, DifferentCompactionStyles) { TEST_F(ColumnFamilyTest, DifferentCompactionStyles) {
Open(); Open();
CreateColumnFamilies({"one", "two"}); CreateColumnFamilies({"one", "two"});
@ -1204,6 +1203,7 @@ TEST_F(ColumnFamilyTest, DifferentCompactionStyles) {
Close(); Close();
} }
#endif // !ROCKSDB_LITE
#ifndef ROCKSDB_LITE #ifndef ROCKSDB_LITE
// Sync points not supported in RocksDB Lite // Sync points not supported in RocksDB Lite
@ -2097,6 +2097,7 @@ TEST_F(ColumnFamilyTest, ReadOnlyDBTest) {
} }
#endif // !ROCKSDB_LITE #endif // !ROCKSDB_LITE
#ifndef ROCKSDB_LITE // WaitForFlush() is not supported in lite
TEST_F(ColumnFamilyTest, DontRollEmptyLogs) { TEST_F(ColumnFamilyTest, DontRollEmptyLogs) {
Open(); Open();
CreateColumnFamiliesAndReopen({"one", "two", "three", "four"}); CreateColumnFamiliesAndReopen({"one", "two", "three", "four"});
@ -2118,7 +2119,9 @@ TEST_F(ColumnFamilyTest, DontRollEmptyLogs) {
ASSERT_EQ(static_cast<size_t>(total_new_writable_files), handles_.size() + 1); ASSERT_EQ(static_cast<size_t>(total_new_writable_files), handles_.size() + 1);
Close(); Close();
} }
#endif // !ROCKSDB_LITE
#ifndef ROCKSDB_LITE // WaitForCompaction() is not supported in lite
TEST_F(ColumnFamilyTest, FlushStaleColumnFamilies) { TEST_F(ColumnFamilyTest, FlushStaleColumnFamilies) {
Open(); Open();
CreateColumnFamilies({"one", "two"}); CreateColumnFamilies({"one", "two"});
@ -2152,6 +2155,7 @@ TEST_F(ColumnFamilyTest, FlushStaleColumnFamilies) {
ASSERT_EQ(0, dbfull()->TEST_total_log_size()); ASSERT_EQ(0, dbfull()->TEST_total_log_size());
Close(); Close();
} }
#endif // !ROCKSDB_LITE
TEST_F(ColumnFamilyTest, CreateMissingColumnFamilies) { TEST_F(ColumnFamilyTest, CreateMissingColumnFamilies) {
Status s = TryOpen({"one", "two"}); Status s = TryOpen({"one", "two"});
@ -2873,6 +2877,7 @@ TEST_F(ColumnFamilyTest, FlushCloseWALFiles) {
} }
#endif // !ROCKSDB_LITE #endif // !ROCKSDB_LITE
#ifndef ROCKSDB_LITE // WaitForFlush() is not supported
TEST_F(ColumnFamilyTest, IteratorCloseWALFile1) { TEST_F(ColumnFamilyTest, IteratorCloseWALFile1) {
SpecialEnv env(Env::Default()); SpecialEnv env(Env::Default());
db_options_.env = &env; db_options_.env = &env;
@ -2972,6 +2977,7 @@ TEST_F(ColumnFamilyTest, IteratorCloseWALFile2) {
db_options_.env = env_; db_options_.env = env_;
Close(); Close();
} }
#endif // !ROCKSDB_LITE
#ifndef ROCKSDB_LITE // TEST functions are not supported in lite #ifndef ROCKSDB_LITE // TEST functions are not supported in lite
TEST_F(ColumnFamilyTest, ForwardIteratorCloseWALFile) { TEST_F(ColumnFamilyTest, ForwardIteratorCloseWALFile) {