Add KEEP_DB env var option

Summary:
When debugging tests, it's useful to preserve the DB to investigate it and check the logs
This will allow us to set KEEP_DB=1 to preserve the DB
Closes https://github.com/facebook/rocksdb/pull/1759

Differential Revision: D4393826

Pulled By: IslamAbdelRahman

fbshipit-source-id: 1bff689
main
Islam AbdelRahman 8 years ago committed by Facebook Github Bot
parent 77b4806625
commit 3ce091fd73
  1. 5
      db/db_test_util.cc

@ -72,7 +72,12 @@ DBTestBase::~DBTestBase() {
options.db_paths.emplace_back(dbname_ + "_2", 0);
options.db_paths.emplace_back(dbname_ + "_3", 0);
options.db_paths.emplace_back(dbname_ + "_4", 0);
if (getenv("KEEP_DB")) {
printf("DB is still at %s\n", dbname_.c_str());
} else {
EXPECT_OK(DestroyDB(dbname_, options));
}
delete env_;
}

Loading…
Cancel
Save