From 5f00af45708b0a40a7aaac630807871096643a7a Mon Sep 17 00:00:00 2001 From: sdong Date: Wed, 11 Feb 2015 16:11:40 -0800 Subject: [PATCH] DBTest.DestroyDBMetaDatabase: create DB directories if not exists Summary: DBTest.DestroyDBMetaDatabase occasionally fails on my dev host, for file not existing. Always create directories to avoid that. Test Plan: Run the test Reviewers: rven, yhchiang, igor Reviewed By: igor Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D33321 --- db/db_test.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/db/db_test.cc b/db/db_test.cc index 0431964df..fda54707b 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -6540,8 +6540,11 @@ TEST(DBTest, DBOpen_Change_NumLevels) { TEST(DBTest, DestroyDBMetaDatabase) { std::string dbname = test::TmpDir(env_) + "/db_meta"; + ASSERT_OK(env_->CreateDirIfMissing(dbname)); std::string metadbname = MetaDatabaseName(dbname, 0); + ASSERT_OK(env_->CreateDirIfMissing(metadbname)); std::string metametadbname = MetaDatabaseName(metadbname, 0); + ASSERT_OK(env_->CreateDirIfMissing(metametadbname)); // Destroy previous versions if they exist. Using the long way. Options options = CurrentOptions();