Skip to content

fix: use best-effort artifacts folder removal#191

Merged
mxschmitt merged 3 commits intomainfrom
bugfix/cleanup
Oct 10, 2023
Merged

fix: use best-effort artifacts folder removal#191
mxschmitt merged 3 commits intomainfrom
bugfix/cleanup

Conversation

@mxschmitt
Copy link
Copy Markdown
Contributor

Fixes #163

Comment thread pytest_playwright/pytest_playwright.py Outdated
Comment thread pytest_playwright/pytest_playwright.py Outdated
except (PermissionError, NotADirectoryError):
for file in os.listdir(artifacts_folder.name):
try:
os.remove(os.path.join(artifacts_folder.name, file))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we have a sub-directory there? Shouldn't this be rmtree? Alternatively, we can:

  • ignore the error and not cleanup;
  • retry artifacts_folder.cleanup() after a timeout;
  • implement smart recursive retrying like rimraf.

mxschmitt and others added 2 commits October 10, 2023 18:32
@mxschmitt mxschmitt merged commit ef99541 into main Oct 10, 2023
@mxschmitt mxschmitt deleted the bugfix/cleanup branch October 10, 2023 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

artifacts_folder.cleanup() raises PermissionError: [WinError 32]

2 participants