-
-
Notifications
You must be signed in to change notification settings - Fork 8
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 finalizeSchema more robust by not handling behavior schema classes. #55
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
Backported from version 2.0. This fixes test failures on Plone 5.2 Python 3 when used together with plone/plone.dexterity#189, which is a backport of a memory leak fix. Failures are like this: ``` File "/home/jenkins/.buildout/eggs/cp38/plone.autoform-1.9.1-py3.8.egg/plone/autoform/tests/../autoform.rst", line 50, in autoform.rst Failed example: xmlconfig.xmlconfig(StringIO(configuration)) Exception raised: Traceback (most recent call last): File "/srv/python3.8/lib/python3.8/doctest.py", line 1336, in __run exec(compile(example.source, filename, "single", File "<doctest autoform.rst[11]>", line 1, in <module> xmlconfig.xmlconfig(StringIO(configuration)) File "/home/jenkins/.buildout/eggs/cp38/zope.configuration-4.4.1-py3.8.egg/zope/configuration/xmlconfig.py", line 732, in xmlconfig context.execute_actions(testing=testing) File "/home/jenkins/.buildout/eggs/cp38/zope.configuration-4.4.1-py3.8.egg/zope/configuration/config.py", line 799, in execute_actions reraise( File "/home/jenkins/.buildout/eggs/cp38/zope.configuration-4.4.1-py3.8.egg/zope/configuration/_compat.py", line 31, in reraise raise value.with_traceback(tb) File "/home/jenkins/.buildout/eggs/cp38/zope.configuration-4.4.1-py3.8.egg/zope/configuration/config.py", line 791, in execute_actions callable(*args, **kw) File "/home/jenkins/.buildout/eggs/cp38/plone.supermodel-1.6.5-py3.8.egg/plone/supermodel/model.py", line 116, in finalizeSchemas for schema in sorted(schemas): zope.configuration.config.ConfigurationExecutionError: File "/home/jenkins/.buildout/eggs/cp38/plone.supermodel-1.6.5-py3.8.egg/plone/supermodel/configure.zcml", line 9.4-12.10 <zcml:customAction handler=".model.finalizeSchemas" order="9999999" /> TypeError: '<' not supported between instances of 'Provides' and 'InterfaceClass' ``` The test failures are mostly in `plone.autoform` and in `plone.app.registry`, but strangely you do not get the error when you run only the tests for one of those packages. You really need to run the entire Plone test suite (`bin/test` in coredev, without options). So there is likely some test leakage. Python 2 does not have this problem: sorting on Python 3 is handled differently. On Python 2: ``` >>> from zope.interface.declarations import Implements, Provides >>> sorted([Implements(), Provides(object)]) [classImplements(?), directlyProvides(object)] ``` On Python 3: ``` >>> from zope.interface.declarations import Implements, Provides >>> sorted([Implements(), Provides(object)]) Traceback (most recent call last): File "<console>", line 1, in <module> TypeError: '<' not supported between instances of 'Provides' and 'Implements' ```
This comment was marked as resolved.
This comment was marked as resolved.
I am testing this on Jenkins together with plone/plone.dexterity#189. |
gforcada
approved these changes
Nov 9, 2023
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! 💯
mamico
approved these changes
Nov 9, 2023
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
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.
This is for the branch used in Plone 5.2.
Backported from version 2.0, specifically PR #27 which was needed to get the dexterity site root working. I already commented there two years ago that I wondered if this would be safe for 5.2 as well.
This fixes test failures on Plone 5.2 Python 3 when used together with plone/plone.dexterity#189, which is a backport of a memory leak fix. Failures are like this:
The test failures are mostly in
plone.autoform
and inplone.app.registry
, but strangely you do not get the error when you run only the tests for one of those packages. You really need to run the entire Plone test suite (bin/test
in coredev, without options). So there is likely some test leakage. See all failures on Jenkins.Python 2 does not have this problem: sorting on Python 3 is handled differently. On Python 2:
On Python 3: