crash_test to put DB under TEST_TMPDIR

Summary: Currently crash_test only puts data under /tmp. It is less flexible if we want to cover different file systems or media. Make crash_test to appreciate TEST_TMPDIR so that users can run it against another file system.

Test Plan: Run blackbox_crash_test and whitebox_crash_test with or without TEST_TMPDIR set and make sure DBs are put in the right place

Reviewers: kradhakrishnan, yhchiang, rven, IslamAbdelRahman

Reviewed By: IslamAbdelRahman

Subscribers: leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D43509
main
sdong 10 years ago
parent 1205bdbcee
commit 2e73bd4ff2
  1. 6
      tools/db_crashtest.py
  2. 7
      tools/db_crashtest2.py

@ -67,7 +67,11 @@ def main(argv):
+ str(ops_per_thread) + "\nwrite_buffer_size="
+ str(write_buf_size) + "\n")
dbname = tempfile.mkdtemp(prefix='rocksdb_crashtest_')
test_tmpdir = os.environ.get("TEST_TMPDIR")
if test_tmpdir is None or test_tmpdir == "":
dbname = tempfile.mkdtemp(prefix='rocksdb_crashtest_')
else:
dbname = test_tmpdir + "/rocksdb_crashtest"
while time.time() < exit_time:
run_had_errors = False

@ -70,7 +70,12 @@ def main(argv):
total_check_mode = 4
check_mode = 0
dbname = tempfile.mkdtemp(prefix='rocksdb_crashtest_')
test_tmpdir = os.environ.get("TEST_TMPDIR")
if test_tmpdir is None or test_tmpdir == "":
dbname = tempfile.mkdtemp(prefix='rocksdb_crashtest2_')
else:
dbname = test_tmpdir + "/rocksdb_crashtest2"
while time.time() < exit_time:
killoption = ""
if check_mode == 0:

Loading…
Cancel
Save