mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 05:53:43 +00:00
test_runner: Add error handling for test directory clean up.
It was discovered that errors such as:
`OSError: [Errno 16] Device or resource busy`
potentially arise when running in serial mode, or with
explicit test cases passed to `test-backend`.
This commit is contained in:
@@ -479,8 +479,11 @@ class Runner(DiscoverRunner):
|
|||||||
os.remove(filepath)
|
os.remove(filepath)
|
||||||
|
|
||||||
# Clean up our test runs root directory.
|
# Clean up our test runs root directory.
|
||||||
if os.path.exists(TEST_RUN_DIR):
|
try:
|
||||||
shutil.rmtree(TEST_RUN_DIR)
|
shutil.rmtree(TEST_RUN_DIR)
|
||||||
|
except OSError:
|
||||||
|
print("Unable to clean up the test run's directory.")
|
||||||
|
pass
|
||||||
return super().teardown_test_environment(*args, **kwargs)
|
return super().teardown_test_environment(*args, **kwargs)
|
||||||
|
|
||||||
def test_imports(self, test_labels: List[str], suite: unittest.TestSuite) -> None:
|
def test_imports(self, test_labels: List[str], suite: unittest.TestSuite) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user