summaryrefslogtreecommitdiff
path: root/buildscripts/resmokelib/testing/fixtures/standalone.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildscripts/resmokelib/testing/fixtures/standalone.py')
-rw-r--r--buildscripts/resmokelib/testing/fixtures/standalone.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/buildscripts/resmokelib/testing/fixtures/standalone.py b/buildscripts/resmokelib/testing/fixtures/standalone.py
index 7aaa34fa3de..9e7c7ff6e3a 100644
--- a/buildscripts/resmokelib/testing/fixtures/standalone.py
+++ b/buildscripts/resmokelib/testing/fixtures/standalone.py
@@ -48,8 +48,14 @@ class MongoDFixture(interface.Fixture):
def setup(self):
"""Set up the mongod."""
- if not self.preserve_dbpath:
- utils.rmtree(self._dbpath, ignore_errors=True)
+ if not self.preserve_dbpath and os.path.lexists(self._dbpath):
+
+ def handle_rmtree_failure(fn, path, excinfo):
+ """Handle a failure from rmtree."""
+ self.logger.warning("'%s' threw an exception trying to act on '%s'."
+ " excinfo: %s.", fn, path, excinfo[:2])
+
+ utils.rmtree(self._dbpath, ignore_errors=False, onerror=handle_rmtree_failure)
try:
os.makedirs(self._dbpath)