Skip to content

fix: empty a busy output folder instead of deleting relative to cwd - #353

Merged
Dmitry Gozman (dgozman) merged 2 commits into
microsoft:mainfrom
patrick-immometrica:fix/output-dir-busy-cleanup
Nov 24, 2026
Merged

Dmitry Gozman (dgozman) merged 2 commits into
microsoft:mainfrom
patrick-immometrica:fix/output-dir-busy-cleanup

Conversation

@patrick-immometrica

Copy link
Copy Markdown
Contributor

When test-results can't be removed (EBUSY, e.g. it's a mounted volume), the fallback lists the folder and calls shutil.rmtree(entry) with the bare name. That path is relative to the cwd, not the output folder, so a folder with the same name next to test-results gets deleted, and a plain file in the output folder makes the session error out.

Entries are now joined with the output folder, and files go through os.remove. Added a test for both plugins.

@patrick-immometrica

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

…folder

Removing the output folder stops at the first busy entry, for example a
volume mounted inside of it, and removing that entry again in the fallback
fails the same way, so every test errors out.

Retry the removal ignoring errors instead, which removes everything else
and leaves behind only what cannot be removed. The tests now simulate a
busy entry the way a mount point behaves: it is emptied, and then removing
the folder itself fails with EBUSY.
@dgozman
Dmitry Gozman (dgozman) merged commit 6284e98 into microsoft:main Nov 24, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants