crash_test cleans up directory before testing if TEST_TMPDIR is set

Summary: In a recent change, crash_test can put data under TEST_TMPDIR. However, the directory is not cleaned before running the test, which may cause unexpected results. Clean it.

Test Plan: Run white and black box crash test against non-existing, or non-empty but not compactible DBs, and make sure it works as expected.

Reviewers: kradhakrishnan, rven, yhchiang, IslamAbdelRahman

Reviewed By: IslamAbdelRahman

Subscribers: leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D43515
main
sdong 10 years ago
parent 24daff6d7a
commit cf3e05304f
  1. 1
      tools/db_crashtest.py
  2. 1
      tools/db_crashtest2.py

@ -72,6 +72,7 @@ def main(argv):
dbname = tempfile.mkdtemp(prefix='rocksdb_crashtest_')
else:
dbname = test_tmpdir + "/rocksdb_crashtest"
shutil.rmtree(dbname, True)
while time.time() < exit_time:
run_had_errors = False

@ -77,6 +77,7 @@ def main(argv):
dbname = tempfile.mkdtemp(prefix='rocksdb_crashtest2_')
else:
dbname = test_tmpdir + "/rocksdb_crashtest2"
shutil.rmtree(dbname, True)
while time.time() < exit_time:
killoption = ""

Loading…
Cancel
Save