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
This commit is contained in:
sdong 2015-08-04 12:20:38 -07:00
parent 24daff6d7a
commit cf3e05304f
2 changed files with 2 additions and 0 deletions

View File

@ -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

View File

@ -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 = ""