-
Notifications
You must be signed in to change notification settings - Fork 892
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
Use utils::remove_file in utils::ensure_file_removed #2752
Use utils::remove_file in utils::ensure_file_removed #2752
Conversation
Is there a good reason that you didn't add those unit-like tests as unit tests in utils.rs, rather than creating an integration test file? |
No, actually. I'll move them. |
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.
Thanks for your contribution.
rest LGTM. It's better to squash your commits.
Thanks. I'll remember to squash next time. |
I've approved the workflow to run. If everything goes green then I'd like to see a cleaned up commit series before I do a final pass |
unit test for utils::remove_file add a test for utils::ensure_file_removed newline comment potential solution drill down to find error type remove integration tests, moved to utils.rs moved tests here Update src/utils/utils.rs Co-authored-by: 二手掉包工程师 <rustin.liu@gmail.com> Update src/utils/utils.rs Co-authored-by: 二手掉包工程师 <rustin.liu@gmail.com> add a message to panic cargo fmt
acf88e8
to
77eed8d
Compare
I'm guessing this is a transient error, but I don't know for sure. |
This is part of a problem with Rustup we're trying to bottom out on another PR, so don't worry that you might have caused 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.
This looks good to me, assuming a green CI (modulo any 1.24 related iffies) I'll merge.
@joshrotenberg Thank you for picking this bug up and fixing it ! <3 |
This change calls
utils::remove_file
inutils::ensure_file_removed
instead of callingfs::remove_file
in order to take advantage of the retry. The logic is essentially the same: if the result is an error but the error type isNotFound
, returnOk(())
, otherwise return whatever the actual result is. With this change, the error type is buried a little bit deeper in the result.In addition, some basic tests have been added to verify the functionality of both
remove_file
andensure_file_removed
with regards to this change.Fixes #2734.