make DBTest.SharedWriteBuffer to pass MockEnv

Summary: DBTest.SharedWriteBuffer uses an Options that doesn't pass CurrentOptions(), so that it doesn't use MockEnv. However, DBTest's constructor uses MockEnv to call DestoryDB() to clean up, causing uncleaned state before it runs.

Test Plan: Run the test modified to make sure they pass default Env and SharedWriteBuffer now passes MockEnv.

Reviewers: rven, yhchiang, igor

Reviewed By: igor

Subscribers: leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D32475
main
sdong 10 years ago
parent 4bdf38b16e
commit d07fec3bdc
  1. 8
      db/db_test.cc

@ -3995,7 +3995,7 @@ TEST(DBTest, UniversalCompactionCompressRatio2) {
} }
TEST(DBTest, FailMoreDbPaths) { TEST(DBTest, FailMoreDbPaths) {
Options options; Options options = CurrentOptions();
options.db_paths.emplace_back(dbname_, 10000000); options.db_paths.emplace_back(dbname_, 10000000);
options.db_paths.emplace_back(dbname_ + "_2", 1000000); options.db_paths.emplace_back(dbname_ + "_2", 1000000);
options.db_paths.emplace_back(dbname_ + "_3", 1000000); options.db_paths.emplace_back(dbname_ + "_3", 1000000);
@ -4099,7 +4099,7 @@ TEST(DBTest, UniversalCompactionSecondPathRatio) {
} }
TEST(DBTest, LevelCompactionThirdPath) { TEST(DBTest, LevelCompactionThirdPath) {
Options options; Options options = CurrentOptions();
options.db_paths.emplace_back(dbname_, 500 * 1024); options.db_paths.emplace_back(dbname_, 500 * 1024);
options.db_paths.emplace_back(dbname_ + "_2", 4 * 1024 * 1024); options.db_paths.emplace_back(dbname_ + "_2", 4 * 1024 * 1024);
options.db_paths.emplace_back(dbname_ + "_3", 1024 * 1024 * 1024); options.db_paths.emplace_back(dbname_ + "_3", 1024 * 1024 * 1024);
@ -4212,7 +4212,7 @@ TEST(DBTest, LevelCompactionThirdPath) {
} }
TEST(DBTest, LevelCompactionPathUse) { TEST(DBTest, LevelCompactionPathUse) {
Options options; Options options = CurrentOptions();
options.db_paths.emplace_back(dbname_, 500 * 1024); options.db_paths.emplace_back(dbname_, 500 * 1024);
options.db_paths.emplace_back(dbname_ + "_2", 4 * 1024 * 1024); options.db_paths.emplace_back(dbname_ + "_2", 4 * 1024 * 1024);
options.db_paths.emplace_back(dbname_ + "_3", 1024 * 1024 * 1024); options.db_paths.emplace_back(dbname_ + "_3", 1024 * 1024 * 1024);
@ -7154,7 +7154,7 @@ TEST(DBTest, RecoverCheckFileAmount) {
} }
TEST(DBTest, SharedWriteBuffer) { TEST(DBTest, SharedWriteBuffer) {
Options options; Options options = CurrentOptions();
options.db_write_buffer_size = 100000; // this is the real limit options.db_write_buffer_size = 100000; // this is the real limit
options.write_buffer_size = 500000; // this is never hit options.write_buffer_size = 500000; // this is never hit
CreateAndReopenWithCF({"pikachu", "dobrynia", "nikitich"}, options); CreateAndReopenWithCF({"pikachu", "dobrynia", "nikitich"}, options);

Loading…
Cancel
Save