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
main
sdong 10 years ago
parent 68af7811ea
commit 5f00af4570
  1. 3
      db/db_test.cc

@ -6540,8 +6540,11 @@ TEST(DBTest, DBOpen_Change_NumLevels) {
TEST(DBTest, DestroyDBMetaDatabase) { TEST(DBTest, DestroyDBMetaDatabase) {
std::string dbname = test::TmpDir(env_) + "/db_meta"; std::string dbname = test::TmpDir(env_) + "/db_meta";
ASSERT_OK(env_->CreateDirIfMissing(dbname));
std::string metadbname = MetaDatabaseName(dbname, 0); std::string metadbname = MetaDatabaseName(dbname, 0);
ASSERT_OK(env_->CreateDirIfMissing(metadbname));
std::string metametadbname = MetaDatabaseName(metadbname, 0); std::string metametadbname = MetaDatabaseName(metadbname, 0);
ASSERT_OK(env_->CreateDirIfMissing(metametadbname));
// Destroy previous versions if they exist. Using the long way. // Destroy previous versions if they exist. Using the long way.
Options options = CurrentOptions(); Options options = CurrentOptions();

Loading…
Cancel
Save