From 0c6e8be9e205d434a29418410155397f2a762e58 Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Wed, 10 Jan 2018 15:36:48 -0800 Subject: [PATCH] Fix directory name for db_basic_test Summary: It was using the same directory as `db_options_test` so transiently failed when unit tests were run in parallel. Closes https://github.com/facebook/rocksdb/pull/3352 Differential Revision: D6691649 Pulled By: ajkr fbshipit-source-id: bee433484fec4faedd5cadf2db3c92fdcc99a170 --- db/db_basic_test.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/db/db_basic_test.cc b/db/db_basic_test.cc index 6fe33a193..8f2679cae 100644 --- a/db/db_basic_test.cc +++ b/db/db_basic_test.cc @@ -570,19 +570,19 @@ TEST_F(DBBasicTest, CompactBetweenSnapshots) { TEST_F(DBBasicTest, DBOpen_Options) { Options options = CurrentOptions(); - std::string dbname = test::TmpDir(env_) + "/db_options_test"; - ASSERT_OK(DestroyDB(dbname, options)); + Close(); + Destroy(options); // Does not exist, and create_if_missing == false: error DB* db = nullptr; options.create_if_missing = false; - Status s = DB::Open(options, dbname, &db); + Status s = DB::Open(options, dbname_, &db); ASSERT_TRUE(strstr(s.ToString().c_str(), "does not exist") != nullptr); ASSERT_TRUE(db == nullptr); // Does not exist, and create_if_missing == true: OK options.create_if_missing = true; - s = DB::Open(options, dbname, &db); + s = DB::Open(options, dbname_, &db); ASSERT_OK(s); ASSERT_TRUE(db != nullptr); @@ -592,14 +592,14 @@ TEST_F(DBBasicTest, DBOpen_Options) { // Does exist, and error_if_exists == true: error options.create_if_missing = false; options.error_if_exists = true; - s = DB::Open(options, dbname, &db); + s = DB::Open(options, dbname_, &db); ASSERT_TRUE(strstr(s.ToString().c_str(), "exists") != nullptr); ASSERT_TRUE(db == nullptr); // Does exist, and error_if_exists == false: OK options.create_if_missing = true; options.error_if_exists = false; - s = DB::Open(options, dbname, &db); + s = DB::Open(options, dbname_, &db); ASSERT_OK(s); ASSERT_TRUE(db != nullptr);