Commit b4801842 authored by Tricia Crichton's avatar Tricia Crichton Committed by Commit Bot

[ChromeDriver] Fix unable to delete temp dirs on exit test

When running run_py_tests.py, chmod on temp dirs can fail occasionally.
Wrapped the command with try/except to suppress the error and
allow tests process to complete.

Change-Id: I896f10021348f45a065a66787a4bad5dcb01b70f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1732150
Commit-Queue: Tricia Crichton <triciac@chromium.org>
Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683406}
parent 5d6c4ec7
...@@ -87,7 +87,10 @@ def _DeleteDir(path): ...@@ -87,7 +87,10 @@ def _DeleteDir(path):
for root, dirs, files in os.walk(path, topdown=False): for root, dirs, files in os.walk(path, topdown=False):
for name in files: for name in files:
filename = os.path.join(root, name) filename = os.path.join(root, name)
os.chmod(filename, stat.S_IWRITE) try:
os.chmod(filename, stat.S_IWRITE)
except OSError:
pass
os.remove(filename) os.remove(filename)
for name in dirs: for name in dirs:
os.rmdir(os.path.join(root, name)) os.rmdir(os.path.join(root, name))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment