-
Notifications
You must be signed in to change notification settings - Fork 59
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
Make sure top-level model is not garbage collected in UnitTestHarness #1317
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Merged
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1317 +/- ##
=======================================
Coverage 94.39% 94.39%
=======================================
Files 371 371
Lines 37922 37922
=======================================
Hits 35796 35796
Misses 2126 2126 ☔ View full report in Codecov by Sentry. |
MarcusHolly
approved these changes
Feb 28, 2024
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.
LGTM - thanks for handling this
lbianchi-lbl
approved these changes
Feb 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes/Resolves: N/A
Fixes failures on #1301.
Summary/Motivation:
The
UnitTestHarness
was implemented in such a fashion that the top-level Pyomo model could be garbage collected while it was running, leading to unpredictable behavior. This unpredictable behavior can be made deterministic by manually invoking Python's garbage collector (409e529).This PR would make a few changes to the
UnitTestHarness
API to ensure the top-level Pyomo model is not garbage collected during tests. It also updates theUnitTestHarness
to use the IDAESinitialization_tester
function, as this was now an easy fix.Changes proposed in this PR:
configure
(9f31b1d)initialization_tester
(52e18eb)UnitTestHarness
a proper abstract base class (ba7d92f)Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: