summaryrefslogtreecommitdiff
path: root/buildscripts
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2018-01-24 14:13:20 -0500
committerMathias Stearn <mathias@10gen.com>2018-01-29 10:57:53 -0500
commitc52b05774918f2a69b8878ae63c63984b8d5bcc9 (patch)
tree1fa1dd937311a3e6e01ef8cc8b64cbd2bc3fed46 /buildscripts
parent4d08499e9ac6cb6da8d76d08d50bb7e205ca4b3e (diff)
downloadmongo-c52b05774918f2a69b8878ae63c63984b8d5bcc9.tar.gz
SERVER-32879 make resmoke clean up after successful dbtest runs
Diffstat (limited to 'buildscripts')
-rw-r--r--buildscripts/resmokelib/testing/testcases/dbtest.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/buildscripts/resmokelib/testing/testcases/dbtest.py b/buildscripts/resmokelib/testing/testcases/dbtest.py
index 13deac9f512..f7bd5ba7504 100644
--- a/buildscripts/resmokelib/testing/testcases/dbtest.py
+++ b/buildscripts/resmokelib/testing/testcases/dbtest.py
@@ -46,7 +46,7 @@ class DBTestCase(interface.TestCase):
dbpath = os.path.join(dbpath_prefix, "job%d" % (self.fixture.job_num), "unittest")
self.dbtest_options["dbpath"] = dbpath
- shutil.rmtree(dbpath, ignore_errors=True)
+ self._clear_dbpath()
try:
os.makedirs(dbpath)
@@ -58,12 +58,16 @@ class DBTestCase(interface.TestCase):
try:
dbtest = self._make_process()
self._execute(dbtest)
+ self._clear_dbpath()
except self.failureException:
raise
except:
self.logger.exception("Encountered an error running dbtest suite %s.", self.basename())
raise
+ def _clear_dbpath(self):
+ shutil.rmtree(self.dbtest_options["dbpath"], ignore_errors=True)
+
def _make_process(self):
return core.programs.dbtest_program(self.logger,
executable=self.dbtest_executable,