Closed rikigigi closed 11 months ago
@sphuber I don't understand why 4 test fail here https://github.com/aiidateam/plumpy/actions/runs/6012847906/job/16309013751?pr=274 ... do you have any idea?
For me the call_with_super_check
is a little bit obscure...
Thank you very much
The call_with_super_check
is a decorator that can be used for a classes method, which ensures that if it is subclassed, the subclass calls super()
or it raises an exception. The problem is that it is not quite sure which subclass it is complaining about. I have looked through your changes, and I don't immediately see any place where you have forgotten to call the super. Will have to look into it later.
I think that the reason that prevented call_with_super_check from working was the fact that it used a single counter for all function. In my case it was called multiple times in the stack. Unfortunately to make the persistence of the Listener, I had to introduce some ugly hacks in the test suite to avoid circular references and to correctly compare snapshots.
The timeout issue is not present in my local run of the test suite :-(
did a simple test with https://github.com/aiidateam/aiida-core/pull/5732/ rebased on current develop + https://github.com/sphuber/aiida-s3 and it worked fine, with the ProcessListener being correctly called on the aiida daemon
Attention: 10 lines
in your changes are missing coverage. Please review.
Comparison is base (
44d27d1
) 90.83% compared to head (8724b83
) 90.76%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@sphuber just a ping. Are the changes in the call_with_super_check ok? Thank you
Sorry for the delay @rikigigi . Could you please give a small writeup as to why these hacks were necessary and what they are doing?
I reverted the changes on the call_with_super_check, but a small details that prints the name of the correct function in case of error. They were not necessary.
The issue with the tests is simple: the
class ProcessSaver(plumpy.ProcessListener)
is defined as a Listener. If now the ProcessListener is persistent, when we save the Process in the tests a mess happens because of the saved instance of the class inside the ProcessListener, that have inside it the ProcessListener itself. So What I did is to modify the ProcessSaver to not store directly inside it the Process to save but to use an external global dictionary where we save the Process by instance id. In this way we avoid the circular reference and we don't have to change all the tests.
Also, please install pre-commit
. Inside the repo, simply run pre-commit install
. This way the pre-commit linter autoamtically runs when you commit. This will fix the broken CI.
Finally, maybe you want to merge this into https://github.com/aiidateam/plumpy/tree/support/0.21.x instead. aiida-core
is currently stuck on v0.21.x
. If we merge this into master
it will have to be released with v0.22.x
instead, and so you won't be able to install it with aiida-core
. So you may want to rebase this onto the support/0.21.x
branch
ok, thank you! I'm working on it.
I addressed the issues and created a different PR for 0.21.x support https://github.com/aiidateam/plumpy/pull/277
I am closing this as I cherry-picked your fix that was released with the v0.21.10 support in #279 so it is now also on master
solves https://github.com/aiidateam/plumpy/issues/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