From 719be84424da1d8a93d2afc2dfc4583f2a93faf8 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Fri, 27 Apr 2018 11:54:28 -0400 Subject: [PATCH] Ignore errors on cleanup in test_return_codes 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. --- stestr/tests/test_return_codes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stestr/tests/test_return_codes.py b/stestr/tests/test_return_codes.py index 160adb77..d4e9bafb 100644 --- a/stestr/tests/test_return_codes.py +++ b/stestr/tests/test_return_codes.py @@ -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