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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: properly remove temporary files leftover after running tests #1762
feat: properly remove temporary files leftover after running tests #1762
Changes from all commits
df83b1a
c8b4744
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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'm not sure that I understand putting
cache_dir.close()
behind anif
.fs::remove_dir
will returnOk
ifcache_dir
contains no files and is successfully removed (which would causecache_dir.path().exists()
to befalse
), or it will return anErr
ifcache_dir
contains files.Would something like the following also work without putting tempdir closing behind an
if
statement?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.
Pretty sure I tried that and it didn't work (would sometimes error on the second line).
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.
Also, if you can find a different way to solve it, it would be appreciated. The goal is just for it to 1) not cause an error, and 2) be gone after the run. Took me a while to get that going and I agree it's weird (but works).
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.
Oh, that is weird. If you've already tried alternatives to the
if
and the tests' temp-files weren't fully removed, then the PR looks good to me.