Skip to content
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

WIP: Fix lineage recursion (another attempt) #108

Closed
wants to merge 4 commits into from

Conversation

ale-rt
Copy link
Member

@ale-rt ale-rt commented Jul 5, 2019

Alternative to #107

@mister-roboto
Copy link

@ale-rt thanks for creating this Pull Request and help improve Plone!

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass.

Whenever you feel that the pull request is ready to be tested, either start all jenkins jobs pull requests by yourself, or simply add a comment in this pull request stating:

@jenkins-plone-org please run jobs

With this simple comment all the jobs will be started automatically.

Happy hacking!

@ale-rt
Copy link
Member Author

ale-rt commented Jul 5, 2019

@jenkins-plone-org please run jobs

@rpatterson
Copy link
Member

This is plaguing all my Python 3 Plone testing work, so I'm eager to see this get worked out and merged. Here's some more discussion.

@ale-rt
Copy link
Member Author

ale-rt commented Nov 21, 2019

I am not 100% sure of the approach and recently @jensens introduced a similar caching mechanism in #114. I need to check if this is obsolete.
@rpatterson do you still face the recursion issue with plone.dexterity master?

@jensens
Copy link
Sponsor Member

jensens commented Nov 21, 2019

In my opinion this one is obsolete now, but I may have missed something?

@ale-rt
Copy link
Member Author

ale-rt commented Nov 21, 2019

I think you are right, but need to double check
CC @cillianderoiste

@cdw9
Copy link
Member

cdw9 commented Nov 26, 2019

I still get the stack overflow on master, but have not yet seen it happen on this branch.

@cdw9
Copy link
Member

cdw9 commented Nov 26, 2019

@jenkins-plone-org please run jobs

@tkimnguyen
Copy link
Sponsor Member

I don't understand why the https://jenkins.plone.org/job/pull-request-5.2/711/ job is reported as having failed. The Robot Test Summary show 0 failures in the critical test

@tkimnguyen
Copy link
Sponsor Member

taking a look at this again... this is blocking collective.lineage

@ale-rt
Copy link
Member Author

ale-rt commented Feb 8, 2020

I will try to have a look at this at the Alpine City Sprint

@tkimnguyen
Copy link
Sponsor Member

manually running the tests for this branch, I get 5 failures:

$ bin/test -s plone.dexterity
Running zope.testrunner.layer.UnitTests tests:
  Set up zope.testrunner.layer.UnitTests in 0.000 seconds.
  Running:
    18/143 (12.6%)

Error in test test_getSize (plone.dexterity.tests.test_content.TestContent)
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 628, in run
    testMethod()
  File "/Users/kimnguyen/src/plone.dexterity/plone/dexterity/tests/test_content.py", line 1148, in test_getSize
    self.assertEqual(3, item.getSize())
  File "/Users/kimnguyen/src/plone.dexterity/plone/dexterity/filerepresentation.py", line 81, in getSize
    adapter = schema(self)
TypeError: ('Could not adapt', <Item at item>, <InterfaceClass plone.dexterity.tests.test_content.ITest>)

    33/143 (23.1%)

Failure in test test_provided_by_behavior_subtype (plone.dexterity.tests.test_content.TestContent)
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 628, in run
    testMethod()
  File "/Users/kimnguyen/src/plone.dexterity/plone/dexterity/tests/test_content.py", line 275, in test_provided_by_behavior_subtype
    self.assertTrue(ISchema.providedBy(item))
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 705, in assertTrue
    raise self.failureException(msg)
AssertionError: False is not true

    34/143 (23.8%)

Failure in test test_provided_by_behavior_subtype_invalidation (plone.dexterity.tests.test_content.TestContent)
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 628, in run
    testMethod()
  File "/Users/kimnguyen/src/plone.dexterity/plone/dexterity/tests/test_content.py", line 396, in test_provided_by_behavior_subtype_invalidation
    self.assertTrue(ISchema.providedBy(item))
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 705, in assertTrue
    raise self.failureException(msg)
AssertionError: False is not true

    35/143 (24.5%)

Failure in test test_provided_by_item (plone.dexterity.tests.test_content.TestContent)
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 628, in run
    testMethod()
  File "/Users/kimnguyen/src/plone.dexterity/plone/dexterity/tests/test_content.py", line 73, in test_provided_by_item
    self.assertTrue(ISchema.providedBy(item))
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 705, in assertTrue
    raise self.failureException(msg)
AssertionError: False is not true

    36/143 (25.2%)

Failure in test test_provided_by_subclass (plone.dexterity.tests.test_content.TestContent)
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 628, in run
    testMethod()
  File "/Users/kimnguyen/src/plone.dexterity/plone/dexterity/tests/test_content.py", line 128, in test_provided_by_subclass
    self.assertTrue(ISchema.providedBy(item))
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 705, in assertTrue
    raise self.failureException(msg)
AssertionError: False is not true

    37/143 (25.9%)

Failure in test test_provided_by_subclass_nojar (plone.dexterity.tests.test_content.TestContent)
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 628, in run
    testMethod()
  File "/Users/kimnguyen/src/plone.dexterity/plone/dexterity/tests/test_content.py", line 174, in test_provided_by_subclass_nojar
    self.assertTrue(ISchema.providedBy(item))
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 705, in assertTrue
    raise self.failureException(msg)
AssertionError: False is not true

    83/143 (58.0%)/Users/kimnguyen/src/plone.dexterity/plone/dexterity/tests/test_fti.py:632: DeprecationWarning: Please use assertNotEqual instead.
  queryUtility(IDexterityFTI, name=portal_type)
                    
  Ran 143 tests with 5 failures, 1 errors, 0 skipped in 1.010 seconds.
Running plone.testing.zca.UnitTesting tests:
  Tear down zope.testrunner.layer.UnitTests in 0.000 seconds.
  Set up plone.testing.zca.UnitTesting in 0.000 seconds.
  Running:
                    
  Ran 1 tests with 5 failures, 0 errors, 0 skipped in 0.057 seconds.
Tearing down left over layers:
  Tear down plone.testing.zca.UnitTesting in 0.000 seconds.
Total: 144 tests, 5 failures, 1 errors, 0 skipped in 1.208 seconds.
kimnguyen in ~/src/plone.dexterity on fix-lineage-recursion-wip-3*

@tkimnguyen
Copy link
Sponsor Member

tkimnguyen commented Feb 8, 2020

When I run the instance and try to create a site:

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 156, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 338, in publish_module
  Module ZPublisher.WSGIPublisher, line 256, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 62, in call_object
  Module Products.CMFPlone.browser.admin, line 273, in __call__
  Module Products.CMFPlone.factory, line 163, in addPloneSite
  Module Products.GenericSetup.tool, line 393, in runAllImportStepsFromProfile
   - __traceback_info__: profile-plone.app.contenttypes:plone-content
  Module Products.GenericSetup.tool, line 1474, in _runImportStepsFromContext
  Module Products.GenericSetup.tool, line 1321, in _doRunHandler
  Module plone.app.contenttypes.setuphandlers, line 330, in import_content
  Module plone.app.contenttypes.setuphandlers, line 172, in create_frontpage
  Module plone.dexterity.utils, line 138, in createContent
TypeError: ('Could not adapt', <Document at >, <InterfaceClass plone.dexterity.schema.generated.Plone_0_Document>)

@tkimnguyen
Copy link
Sponsor Member

The problem I had with collective.lineage getting a stack overflow is fixed if plone.dexterity is pinned to 2.9.3 or greater (currently 2.9.5). I don't know if that means this PR isn't necessary. Thank you!

@ale-rt
Copy link
Member Author

ale-rt commented Feb 12, 2020

@cillianderoiste can you please check if everything works fine also for you with the latest plone.dexterity?
Then IMHO this branch can be nuked because the optimizations done in master seem really better.

@cillianderoiste
Copy link

I can confirm that I no longer get the lineage recursion error on plone.dexterity 2.9.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants