Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does ignore_errors force the directory to be deleted, even if there are errors? Or does this flag simply allow execution to continue, even though the directory may not have been deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I think it only ignores the error. This function accepts a onError handler. Do you think if we need to handle it in that way? Or maybe leaving an empty directory is acceptable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the description to reflect it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we'll need some sort of equivalent to a
rm -f
solution.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth testing a small python script locally to see if ignore_errors works like
-f
or not.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion. I tried to reproduce it locally with a python script and got more data. This issue is not easy to reproduce. The documentation of
shutil.rmtree
doesn't say that when it would throw "Directory not empty" error. It could be likely caused by race condition mentioned in reframe-hpc/reframe#291.I found this issue when a Booting simulator solution was used originally for #2, which caused the deletion process to be slow and
rmtree
can't be finished in time. It doesn't seem to happen for the time being.I am going to close this PR because
ignore_errors
is not appropriate to be used under this situation.