diff options
author | Mathias Stearn <mathias@10gen.com> | 2018-01-24 14:13:20 -0500 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2018-01-29 10:57:53 -0500 |
commit | c52b05774918f2a69b8878ae63c63984b8d5bcc9 (patch) | |
tree | 1fa1dd937311a3e6e01ef8cc8b64cbd2bc3fed46 /buildscripts | |
parent | 4d08499e9ac6cb6da8d76d08d50bb7e205ca4b3e (diff) | |
download | mongo-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.py | 6 |
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, |