From d07fec3bdcda95e1c0957fc200c78af694a77082 Mon Sep 17 00:00:00 2001 From: sdong Date: Wed, 28 Jan 2015 15:30:02 -0800 Subject: [PATCH] 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 --- db/db_test.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db/db_test.cc b/db/db_test.cc index 067f2869d..a8973a102 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -3995,7 +3995,7 @@ TEST(DBTest, UniversalCompactionCompressRatio2) { } TEST(DBTest, FailMoreDbPaths) { - Options options; + Options options = CurrentOptions(); options.db_paths.emplace_back(dbname_, 10000000); options.db_paths.emplace_back(dbname_ + "_2", 1000000); options.db_paths.emplace_back(dbname_ + "_3", 1000000); @@ -4099,7 +4099,7 @@ TEST(DBTest, UniversalCompactionSecondPathRatio) { } TEST(DBTest, LevelCompactionThirdPath) { - Options options; + Options options = CurrentOptions(); options.db_paths.emplace_back(dbname_, 500 * 1024); options.db_paths.emplace_back(dbname_ + "_2", 4 * 1024 * 1024); options.db_paths.emplace_back(dbname_ + "_3", 1024 * 1024 * 1024); @@ -4212,7 +4212,7 @@ TEST(DBTest, LevelCompactionThirdPath) { } TEST(DBTest, LevelCompactionPathUse) { - Options options; + Options options = CurrentOptions(); options.db_paths.emplace_back(dbname_, 500 * 1024); options.db_paths.emplace_back(dbname_ + "_2", 4 * 1024 * 1024); options.db_paths.emplace_back(dbname_ + "_3", 1024 * 1024 * 1024); @@ -7154,7 +7154,7 @@ TEST(DBTest, RecoverCheckFileAmount) { } TEST(DBTest, SharedWriteBuffer) { - Options options; + Options options = CurrentOptions(); options.db_write_buffer_size = 100000; // this is the real limit options.write_buffer_size = 500000; // this is never hit CreateAndReopenWithCF({"pikachu", "dobrynia", "nikitich"}, options);