-
Notifications
You must be signed in to change notification settings - Fork 17
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
plumpy.ProcessListener made persistent support/0.21.x #277
Conversation
solves aiidateam#273 We implement the persistence of ProcessListener by deriving the class ProcessListener and EventHelper from persistence.Savable. The class EventHelper is moved to a new file because of a circular import with utils and persistence Fixing the test There was a circular reference issue in the test listener that was storing a reference to the process inside it, making its serialization impossible. To fix the tests an ugly hack was used: storing the reference to the process outside the class in a global dict using id as keys. Some more ugly hacks are needed to check correctly the equality of two processes. We must ignore the fact that the instances if the listener are different. We call del on dict items of the ProcessListener's global implemented in the test suite to clean the golbal variables addressed issues in aiidateam#274
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## support/0.21.x #277 +/- ##
==================================================
- Coverage 90.82% 90.72% -0.09%
==================================================
Files 21 22 +1
Lines 2973 2995 +22
==================================================
+ Hits 2700 2717 +17
- Misses 273 278 +5
☔ View full report in Codecov by Sentry. |
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 a lot @rikigigi for the nice work and patience during the review process. I will soon make a release with these changes
The `ProcessListener` is made persistable by deriving it, as well as the `EventHelper` class from `persistence.Savable`. The class `EventHelper` is moved to a new file because of a circular import that would result between the `utils` and `persistence` modules. There was a circular reference issue in the test listener that was storing a reference to the process inside it, making its serialization impossible. To fix the tests an ugly hack was used: storing the reference to the process outside the class in a global dict using id as keys. Some more ugly hacks were needed to correctly check the equality of two processes. Instances having different listeners should be ignored. Cherry-pick: 98a375f
The `ProcessListener` is made persistable by deriving it, as well as the `EventHelper` class from `persistence.Savable`. The class `EventHelper` is moved to a new file because of a circular import that would result between the `utils` and `persistence` modules. There was a circular reference issue in the test listener that was storing a reference to the process inside it, making its serialization impossible. To fix the tests an ugly hack was used: storing the reference to the process outside the class in a global dict using id as keys. Some more ugly hacks were needed to correctly check the equality of two processes. Instances having different listeners should be ignored. Cherry-pick: 98a375f
The `ProcessListener` is made persistable by deriving it, as well as the `EventHelper` class from `persistence.Savable`. The class `EventHelper` is moved to a new file because of a circular import that would result between the `utils` and `persistence` modules. There was a circular reference issue in the test listener that was storing a reference to the process inside it, making its serialization impossible. To fix the tests an ugly hack was used: storing the reference to the process outside the class in a global dict using id as keys. Some more ugly hacks were needed to correctly check the equality of two processes. Instances having different listeners should be ignored. Cherry-pick: 98a375f
Fixes #273
We implement the persistence of ProcessListener by deriving the class ProcessListener and EventHelper from persistence.Savable. The class EventHelper is moved to a new file because of a circular import with utils and persistence
There was a circular reference issue in the test listener that was storing a reference to the process inside it, making its serialization impossible. To fix the tests an ugly hack was used: storing the reference to the process outside the class in a global dict using id as keys. Some more ugly hacks are needed to check correctly the equality of two processes. We must ignore the fact that the instances if the listener are different.
We call del on dict items of the ProcessListener's global implemented in the test suite to clean the golbal variables
addressed issues in #274