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:
parent
24daff6d7a
commit
cf3e05304f
@ -72,6 +72,7 @@ def main(argv):
|
|||||||
dbname = tempfile.mkdtemp(prefix='rocksdb_crashtest_')
|
dbname = tempfile.mkdtemp(prefix='rocksdb_crashtest_')
|
||||||
else:
|
else:
|
||||||
dbname = test_tmpdir + "/rocksdb_crashtest"
|
dbname = test_tmpdir + "/rocksdb_crashtest"
|
||||||
|
shutil.rmtree(dbname, True)
|
||||||
|
|
||||||
while time.time() < exit_time:
|
while time.time() < exit_time:
|
||||||
run_had_errors = False
|
run_had_errors = False
|
||||||
|
@ -77,6 +77,7 @@ def main(argv):
|
|||||||
dbname = tempfile.mkdtemp(prefix='rocksdb_crashtest2_')
|
dbname = tempfile.mkdtemp(prefix='rocksdb_crashtest2_')
|
||||||
else:
|
else:
|
||||||
dbname = test_tmpdir + "/rocksdb_crashtest2"
|
dbname = test_tmpdir + "/rocksdb_crashtest2"
|
||||||
|
shutil.rmtree(dbname, True)
|
||||||
|
|
||||||
while time.time() < exit_time:
|
while time.time() < exit_time:
|
||||||
killoption = ""
|
killoption = ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user