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
Manual cleanup of workspace during garbage collection #656
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #656 +/- ##
=======================================
Coverage 99.41% 99.41%
=======================================
Files 55 55
Lines 9121 9124 +3
Branches 701 702 +1
=======================================
+ Hits 9068 9071 +3
Misses 28 28
Partials 25 25 ☔ View full report in Codecov by Sentry. |
I'm not sure when One can compare it with the main branch, which does have that warning: https://github.com/PennyLaneAI/catalyst/actions/runs/8619522185/job/23624994862 |
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.
Thank you for figuring this out 💯
This reverts commit a3562a4.
This reverts commit a3562a4.
**Context:** PR #656 attempted to remove a warning, but experiments shown that it didn't actually remove the warning. **Description of the Change:** Revert PR #656. Create derived class from `tempfile.Tempdir` and remove the warning generated in the `_cleanup` method. **Benefits:** No warning. **Note**: Needs wheels to test different python versions. I will test once with wheels and then after success I will remove the ci:build-wheels tag. No-cover needs to be added due to different python versions. --------- Co-authored-by: David Ittah <dime10@users.noreply.github.com>
Context: There is a
ResourceWarning
message with contents similar to the following:This is expected from the TemporaryDirectory, which implicitly cleans up after itself.
When this warning is paired with tests that will treat all warnings as errors, such as when using the decorator:
All warnings will instead raise an exception:
Which will then make pytest raise another warning
which since it is treated as an error, may make a test fail.
Description of the Change: In order to avoid this warning, explicitly clean up. This will remove the initial warning that triggers these events.
Benefits: Avoid a warning / tests to fail.
Drawbacks: It is a bit redundant to cleanup explicitly during garbage collection of the parent object.