Skip to content

Commit

Permalink
Ignore errors on cleanup in test_return_codes
Browse files Browse the repository at this point in the history
This commit is an attempt to mitigate #162 where the temp directory
removal is failing on windows CI occasionally. This commit sets the
ignore_errors flag on the shutil.rmtree() call which makes any errors
encountered not fatal. While this isn't ideal because it could result
in leaking the temp directories on test runs. But, since we haven't
encountered this failure on any operating system or environment
besides the windows CI in appveyor the risk of that weighed against
the nondeterministic failures blocking changes minimizes that concern.
  • Loading branch information
mtreinish committed Apr 27, 2018
1 parent 83aac5a commit 719be84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stestr/tests/test_return_codes.py
Expand Up @@ -36,7 +36,7 @@ def setUp(self):
super(TestReturnCodes, self).setUp()
# Setup test dirs
self.directory = tempfile.mkdtemp(prefix='stestr-unit')
self.addCleanup(shutil.rmtree, self.directory)
self.addCleanup(shutil.rmtree, self.directory, ignore_errors=True)
self.test_dir = os.path.join(self.directory, 'tests')
os.mkdir(self.test_dir)
# Setup Test files
Expand Down

0 comments on commit 719be84

Please sign in to comment.