Skip to content

Commit

Permalink
test: revert previous disabled tests (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 authored Apr 18, 2019
1 parent 441dd88 commit e17dfe6
Show file tree
Hide file tree
Showing 40 changed files with 888 additions and 994 deletions.
12 changes: 2 additions & 10 deletions db/c_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,10 +535,6 @@ int main(int argc, char** argv) {

StartPhase("checkpoint");
{
rocksdb_put(db, woptions, "foo", 3, "hello", 5, &err); // PEGASUS: avoid memtable to be empty.
// empty memtable will skip create checkpoint in pegasus
CheckNoError(err);

rocksdb_destroy_db(options, dbcheckpointname, &err);
CheckNoError(err);

Expand Down Expand Up @@ -719,9 +715,8 @@ int main(int argc, char** argv) {
rocksdb_writebatch_destroy(wb);
}

StartPhase("writebatch_savepoint"); // PEGASUS: not support empty batch
StartPhase("writebatch_savepoint");
{
/*
rocksdb_writebatch_t* wb = rocksdb_writebatch_create();
rocksdb_writebatch_set_save_point(wb);
rocksdb_writebatch_set_save_point(wb);
Expand All @@ -738,7 +733,6 @@ int main(int argc, char** argv) {
CheckNoError(err);
CheckGet(db, roptions, "zap", NULL);
rocksdb_writebatch_destroy(wb);
*/
}

StartPhase("writebatch_rep");
Expand Down Expand Up @@ -826,9 +820,8 @@ int main(int argc, char** argv) {
rocksdb_writebatch_wi_destroy(wb);
}

StartPhase("writebatch_wi_savepoint"); // PEGASUS: not support empty batch
StartPhase("writebatch_wi_savepoint");
{
/*
rocksdb_writebatch_wi_t* wb = rocksdb_writebatch_wi_create(0, 1);
rocksdb_writebatch_wi_set_save_point(wb);
const char* k_list[2] = {"z", "ap"};
Expand All @@ -842,7 +835,6 @@ int main(int argc, char** argv) {
CheckNoError(err);
CheckGet(db, roptions, "zap", NULL);
rocksdb_writebatch_wi_destroy(wb);
*/
}

StartPhase("iter");
Expand Down
76 changes: 38 additions & 38 deletions db/column_family_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ TEST_F(ColumnFamilyTest, BulkAddDrop) {
ASSERT_TRUE(families == std::vector<std::string>({"default"}));
}

TEST_F(ColumnFamilyTest, DISABLED_DropTest) {
TEST_F(ColumnFamilyTest, DropTest) {
// first iteration - dont reopen DB before dropping
// second iteration - reopen DB before dropping
for (int iter = 0; iter < 2; ++iter) {
Expand All @@ -764,7 +764,7 @@ TEST_F(ColumnFamilyTest, DISABLED_DropTest) {
}
}

TEST_F(ColumnFamilyTest, DISABLED_WriteBatchFailure) {
TEST_F(ColumnFamilyTest, WriteBatchFailure) {
Open();
CreateColumnFamiliesAndReopen({"one", "two"});
WriteBatch batch;
Expand All @@ -782,7 +782,7 @@ TEST_F(ColumnFamilyTest, DISABLED_WriteBatchFailure) {
Close();
}

TEST_F(ColumnFamilyTest, DISABLED_ReadWrite) {
TEST_F(ColumnFamilyTest, ReadWrite) {
Open();
CreateColumnFamiliesAndReopen({"one", "two"});
ASSERT_OK(Put(0, "foo", "v1"));
Expand All @@ -806,7 +806,7 @@ TEST_F(ColumnFamilyTest, DISABLED_ReadWrite) {
Close();
}

TEST_F(ColumnFamilyTest, DISABLED_IgnoreRecoveredLog) {
TEST_F(ColumnFamilyTest, IgnoreRecoveredLog) {
std::string backup_logs = dbname_ + "/backup_logs";

// delete old files in backup_logs directory
Expand Down Expand Up @@ -884,12 +884,12 @@ TEST_F(ColumnFamilyTest, DISABLED_IgnoreRecoveredLog) {
#ifndef ROCKSDB_LITE // TEST functions used are not supported
TEST_F(ColumnFamilyTest, FlushTest) {
Open();
// CreateColumnFamiliesAndReopen({"one", "two"});
CreateColumnFamiliesAndReopen({"one", "two"});
ASSERT_OK(Put(0, "foo", "v1"));
ASSERT_OK(Put(0, "bar", "v2"));
// ASSERT_OK(Put(1, "mirko", "v3"));
ASSERT_OK(Put(1, "mirko", "v3"));
ASSERT_OK(Put(0, "foo", "v2"));
// ASSERT_OK(Put(2, "fodor", "v5"));
ASSERT_OK(Put(2, "fodor", "v5"));

for (int j = 0; j < 2; j++) {
ReadOptions ro;
Expand All @@ -899,13 +899,13 @@ TEST_F(ColumnFamilyTest, FlushTest) {
ASSERT_OK(db_->NewIterators(ro, handles_, &iterators));
}

for (int i = 0; i < 1; ++i) {
for (int i = 0; i < 3; ++i) {
uint64_t max_total_in_memory_state =
MaxTotalInMemoryState();
Flush(i);
AssertMaxTotalInMemoryState(max_total_in_memory_state);
}
// ASSERT_OK(Put(1, "foofoo", "bar"));
ASSERT_OK(Put(1, "foofoo", "bar"));
ASSERT_OK(Put(0, "foofoo", "bar"));

for (auto* it : iterators) {
Expand All @@ -917,11 +917,11 @@ TEST_F(ColumnFamilyTest, FlushTest) {
for (int iter = 0; iter <= 2; ++iter) {
ASSERT_EQ("v2", Get(0, "foo"));
ASSERT_EQ("v2", Get(0, "bar"));
// ASSERT_EQ("v3", Get(1, "mirko"));
// ASSERT_EQ("v5", Get(2, "fodor"));
ASSERT_EQ("v3", Get(1, "mirko"));
ASSERT_EQ("v5", Get(2, "fodor"));
ASSERT_EQ("NOT_FOUND", Get(0, "fodor"));
// ASSERT_EQ("NOT_FOUND", Get(1, "fodor"));
// ASSERT_EQ("NOT_FOUND", Get(2, "foo"));
ASSERT_EQ("NOT_FOUND", Get(1, "fodor"));
ASSERT_EQ("NOT_FOUND", Get(2, "foo"));
if (iter <= 1) {
Reopen();
}
Expand All @@ -930,7 +930,7 @@ TEST_F(ColumnFamilyTest, FlushTest) {
}

// Makes sure that obsolete log files get deleted
TEST_F(ColumnFamilyTest, DISABLED_LogDeletionTest) {
TEST_F(ColumnFamilyTest, LogDeletionTest) {
db_options_.max_total_wal_size = std::numeric_limits<uint64_t>::max();
column_family_options_.arena_block_size = 4 * 1024;
column_family_options_.write_buffer_size = 128000; // 128KB
Expand Down Expand Up @@ -998,7 +998,7 @@ TEST_F(ColumnFamilyTest, DISABLED_LogDeletionTest) {
}
#endif // !ROCKSDB_LITE

TEST_F(ColumnFamilyTest, DISABLED_CrashAfterFlush) {
TEST_F(ColumnFamilyTest, CrashAfterFlush) {
std::unique_ptr<FaultInjectionTestEnv> fault_env(
new FaultInjectionTestEnv(env_));
db_options_.env = fault_env.get();
Expand Down Expand Up @@ -1038,7 +1038,7 @@ TEST_F(ColumnFamilyTest, OpenNonexistentColumnFamily) {

#ifndef ROCKSDB_LITE // WaitForFlush() is not supported
// Makes sure that obsolete log files get deleted
TEST_F(ColumnFamilyTest, DISABLED_DifferentWriteBufferSizes) {
TEST_F(ColumnFamilyTest, DifferentWriteBufferSizes) {
// disable flushing stale column families
db_options_.max_total_wal_size = std::numeric_limits<uint64_t>::max();
Open();
Expand Down Expand Up @@ -1200,7 +1200,7 @@ TEST_F(ColumnFamilyTest, GetComparator) {
Close();
}

TEST_F(ColumnFamilyTest, DISABLED_DifferentMergeOperators) {
TEST_F(ColumnFamilyTest, DifferentMergeOperators) {
Open();
CreateColumnFamilies({"first", "second"});
ColumnFamilyOptions default_cf, first, second;
Expand Down Expand Up @@ -1231,7 +1231,7 @@ TEST_F(ColumnFamilyTest, DISABLED_DifferentMergeOperators) {
}

#ifndef ROCKSDB_LITE // WaitForFlush() is not supported
TEST_F(ColumnFamilyTest, DISABLED_DifferentCompactionStyles) {
TEST_F(ColumnFamilyTest, DifferentCompactionStyles) {
Open();
CreateColumnFamilies({"one", "two"});
ColumnFamilyOptions default_cf, one, two;
Expand Down Expand Up @@ -1303,7 +1303,7 @@ TEST_F(ColumnFamilyTest, DISABLED_DifferentCompactionStyles) {
#ifndef ROCKSDB_LITE
// Sync points not supported in RocksDB Lite

TEST_F(ColumnFamilyTest, DISABLED_MultipleManualCompactions) {
TEST_F(ColumnFamilyTest, MultipleManualCompactions) {
Open();
CreateColumnFamilies({"one", "two"});
ColumnFamilyOptions default_cf, one, two;
Expand Down Expand Up @@ -1400,7 +1400,7 @@ TEST_F(ColumnFamilyTest, DISABLED_MultipleManualCompactions) {
Close();
}

TEST_F(ColumnFamilyTest, DISABLED_AutomaticAndManualCompactions) {
TEST_F(ColumnFamilyTest, AutomaticAndManualCompactions) {
Open();
CreateColumnFamilies({"one", "two"});
ColumnFamilyOptions default_cf, one, two;
Expand Down Expand Up @@ -1493,7 +1493,7 @@ TEST_F(ColumnFamilyTest, DISABLED_AutomaticAndManualCompactions) {
}
}

TEST_F(ColumnFamilyTest, DISABLED_ManualAndAutomaticCompactions) {
TEST_F(ColumnFamilyTest, ManualAndAutomaticCompactions) {
Open();
CreateColumnFamilies({"one", "two"});
ColumnFamilyOptions default_cf, one, two;
Expand Down Expand Up @@ -1589,7 +1589,7 @@ TEST_F(ColumnFamilyTest, DISABLED_ManualAndAutomaticCompactions) {
}
}

TEST_F(ColumnFamilyTest, DISABLED_SameCFManualManualCompactions) {
TEST_F(ColumnFamilyTest, SameCFManualManualCompactions) {
Open();
CreateColumnFamilies({"one"});
ColumnFamilyOptions default_cf, one;
Expand Down Expand Up @@ -1688,7 +1688,7 @@ TEST_F(ColumnFamilyTest, DISABLED_SameCFManualManualCompactions) {
}
}

TEST_F(ColumnFamilyTest, DISABLED_SameCFManualAutomaticCompactions) {
TEST_F(ColumnFamilyTest, SameCFManualAutomaticCompactions) {
Open();
CreateColumnFamilies({"one"});
ColumnFamilyOptions default_cf, one;
Expand Down Expand Up @@ -1778,7 +1778,7 @@ TEST_F(ColumnFamilyTest, DISABLED_SameCFManualAutomaticCompactions) {
}
}

TEST_F(ColumnFamilyTest, DISABLED_SameCFManualAutomaticCompactionsLevel) {
TEST_F(ColumnFamilyTest, SameCFManualAutomaticCompactionsLevel) {
Open();
CreateColumnFamilies({"one"});
ColumnFamilyOptions default_cf, one;
Expand Down Expand Up @@ -1875,7 +1875,7 @@ TEST_F(ColumnFamilyTest, DISABLED_SameCFManualAutomaticCompactionsLevel) {
// This will wait because there is an unscheduled manual compaction.
// Once the conflict is hit, the manual compaction starts and ends
// Then another automatic will start and end.
TEST_F(ColumnFamilyTest, DISABLED_SameCFManualAutomaticConflict) {
TEST_F(ColumnFamilyTest, SameCFManualAutomaticConflict) {
Open();
CreateColumnFamilies({"one"});
ColumnFamilyOptions default_cf, one;
Expand Down Expand Up @@ -1994,7 +1994,7 @@ TEST_F(ColumnFamilyTest, DISABLED_SameCFManualAutomaticConflict) {
// This will wait because the automatic compaction has files it needs.
// Once the conflict is hit, the automatic compaction starts and ends
// Then the manual will run and end.
TEST_F(ColumnFamilyTest, DISABLED_SameCFAutomaticManualCompactions) {
TEST_F(ColumnFamilyTest, SameCFAutomaticManualCompactions) {
Open();
CreateColumnFamilies({"one"});
ColumnFamilyOptions default_cf, one;
Expand Down Expand Up @@ -2091,7 +2091,7 @@ std::string IterStatus(Iterator* iter) {
}
} // anonymous namespace

TEST_F(ColumnFamilyTest, DISABLED_NewIteratorsTest) {
TEST_F(ColumnFamilyTest, NewIteratorsTest) {
// iter == 0 -- no tailing
// iter == 2 -- tailing
for (int iter = 0; iter < 2; ++iter) {
Expand Down Expand Up @@ -2138,7 +2138,7 @@ TEST_F(ColumnFamilyTest, DISABLED_NewIteratorsTest) {
#endif // !ROCKSDB_LITE

#ifndef ROCKSDB_LITE // ReadOnlyDB is not supported
TEST_F(ColumnFamilyTest, DISABLED_ReadOnlyDBTest) {
TEST_F(ColumnFamilyTest, ReadOnlyDBTest) {
Open();
CreateColumnFamiliesAndReopen({"one", "two", "three", "four"});
ASSERT_OK(Put(0, "a", "b"));
Expand Down Expand Up @@ -2190,7 +2190,7 @@ TEST_F(ColumnFamilyTest, DISABLED_ReadOnlyDBTest) {
#endif // !ROCKSDB_LITE

#ifndef ROCKSDB_LITE // WaitForFlush() is not supported in lite
TEST_F(ColumnFamilyTest, DISABLED_DontRollEmptyLogs) {
TEST_F(ColumnFamilyTest, DontRollEmptyLogs) {
Open();
CreateColumnFamiliesAndReopen({"one", "two", "three", "four"});

Expand All @@ -2214,7 +2214,7 @@ TEST_F(ColumnFamilyTest, DISABLED_DontRollEmptyLogs) {
#endif // !ROCKSDB_LITE

#ifndef ROCKSDB_LITE // WaitForCompaction() is not supported in lite
TEST_F(ColumnFamilyTest, DISABLED_FlushStaleColumnFamilies) {
TEST_F(ColumnFamilyTest, FlushStaleColumnFamilies) {
Open();
CreateColumnFamilies({"one", "two"});
ColumnFamilyOptions default_cf, one, two;
Expand Down Expand Up @@ -2249,7 +2249,7 @@ TEST_F(ColumnFamilyTest, DISABLED_FlushStaleColumnFamilies) {
}
#endif // !ROCKSDB_LITE

TEST_F(ColumnFamilyTest, DISABLED_CreateMissingColumnFamilies) {
TEST_F(ColumnFamilyTest, CreateMissingColumnFamilies) {
Status s = TryOpen({"one", "two"});
ASSERT_TRUE(!s.ok());
db_options_.create_missing_column_families = true;
Expand Down Expand Up @@ -2307,7 +2307,7 @@ TEST_F(ColumnFamilyTest, SanitizeOptions) {
}
}

TEST_F(ColumnFamilyTest, DISABLED_ReadDroppedColumnFamily) {
TEST_F(ColumnFamilyTest, ReadDroppedColumnFamily) {
// iter 0 -- drop CF, don't reopen
// iter 1 -- delete CF, reopen
for (int iter = 0; iter < 2; ++iter) {
Expand Down Expand Up @@ -2379,7 +2379,7 @@ TEST_F(ColumnFamilyTest, DISABLED_ReadDroppedColumnFamily) {
}
}

TEST_F(ColumnFamilyTest, DISABLED_FlushAndDropRaceCondition) {
TEST_F(ColumnFamilyTest, FlushAndDropRaceCondition) {
db_options_.create_missing_column_families = true;
Open({"default", "one"});
ColumnFamilyOptions options;
Expand Down Expand Up @@ -2911,7 +2911,7 @@ TEST_F(ColumnFamilyTest, CompactionSpeedupTwoColumnFamilies) {
}

#ifndef ROCKSDB_LITE
TEST_F(ColumnFamilyTest, DISABLED_FlushCloseWALFiles) {
TEST_F(ColumnFamilyTest, FlushCloseWALFiles) {
SpecialEnv env(Env::Default());
db_options_.env = &env;
db_options_.max_background_flushes = 1;
Expand Down Expand Up @@ -2953,7 +2953,7 @@ TEST_F(ColumnFamilyTest, DISABLED_FlushCloseWALFiles) {
#endif // !ROCKSDB_LITE

#ifndef ROCKSDB_LITE // WaitForFlush() is not supported
TEST_F(ColumnFamilyTest, DISABLED_IteratorCloseWALFile1) {
TEST_F(ColumnFamilyTest, IteratorCloseWALFile1) {
SpecialEnv env(Env::Default());
db_options_.env = &env;
db_options_.max_background_flushes = 1;
Expand Down Expand Up @@ -2998,7 +2998,7 @@ TEST_F(ColumnFamilyTest, DISABLED_IteratorCloseWALFile1) {
Close();
}

TEST_F(ColumnFamilyTest, DISABLED_IteratorCloseWALFile2) {
TEST_F(ColumnFamilyTest, IteratorCloseWALFile2) {
SpecialEnv env(Env::Default());
// Allow both of flush and purge job to schedule.
env.SetBackgroundThreads(2, Env::HIGH);
Expand Down Expand Up @@ -3055,7 +3055,7 @@ TEST_F(ColumnFamilyTest, DISABLED_IteratorCloseWALFile2) {
#endif // !ROCKSDB_LITE

#ifndef ROCKSDB_LITE // TEST functions are not supported in lite
TEST_F(ColumnFamilyTest, DISABLED_ForwardIteratorCloseWALFile) {
TEST_F(ColumnFamilyTest, ForwardIteratorCloseWALFile) {
SpecialEnv env(Env::Default());
// Allow both of flush and purge job to schedule.
env.SetBackgroundThreads(2, Env::HIGH);
Expand Down Expand Up @@ -3132,7 +3132,7 @@ TEST_F(ColumnFamilyTest, DISABLED_ForwardIteratorCloseWALFile) {
// Disable on windows because SyncWAL requires env->IsSyncThreadSafe()
// to return true which is not so in unbuffered mode.
#ifndef OS_WIN
TEST_F(ColumnFamilyTest, DISABLED_LogSyncConflictFlush) {
TEST_F(ColumnFamilyTest, LogSyncConflictFlush) {
Open();
CreateColumnFamiliesAndReopen({"one", "two"});

Expand Down
10 changes: 4 additions & 6 deletions db/compaction_job_stats_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ class CompactionJobStatsTest : public testing::Test,
size_t cfi = handles_.size();
handles_.resize(cfi + cfs.size());
for (auto cf : cfs) {
if (cf != "default") {
ASSERT_OK(db_->CreateColumnFamily(cf_opts, cf, &handles_[cfi++]));
}
ASSERT_OK(db_->CreateColumnFamily(cf_opts, cf, &handles_[cfi++]));
}
}

Expand Down Expand Up @@ -666,7 +664,7 @@ TEST_P(CompactionJobStatsTest, CompactionJobStatsTest) {
options.report_bg_io_stats = true;
for (int test = 0; test < 2; ++test) {
DestroyAndReopen(options);
CreateAndReopenWithCF({"default"}, options);
CreateAndReopenWithCF({"pikachu"}, options);

// 1st Phase: generate "num_L0_files" L0 files.
int num_L0_files = 0;
Expand Down Expand Up @@ -884,7 +882,7 @@ TEST_P(CompactionJobStatsTest, DeletionStatsTest) {
options.max_subcompactions = max_subcompactions_;

DestroyAndReopen(options);
CreateAndReopenWithCF({"default"}, options);
CreateAndReopenWithCF({"pikachu"}, options);

// Stage 1: Generate several L0 files and then send them to L2 by
// using CompactRangeOptions and CompactRange(). These files will
Expand Down Expand Up @@ -976,7 +974,7 @@ TEST_P(CompactionJobStatsTest, UniversalCompactionTest) {
options.max_subcompactions = max_subcompactions_;

DestroyAndReopen(options);
CreateAndReopenWithCF({"default"}, options);
CreateAndReopenWithCF({"pikachu"}, options);

// Generates the expected CompactionJobStats for each compaction
for (uint32_t num_flushes = 2; num_flushes <= kTestScale; num_flushes++) {
Expand Down
Loading

0 comments on commit e17dfe6

Please sign in to comment.