plone / buildout.coredev

Plone Core Development Buildout
http://docs.plone.org/develop/coredev/docs/
74 stars 75 forks source link

Use Zope 4.6.2 on Plone 5.2 #725

Closed mauritsvanrees closed 3 years ago

mauritsvanrees commented 3 years ago

Removed cffi pin, Zope has it already. Removed outdated zope.interface 5.1 annotation.

mauritsvanrees commented 3 years ago

@jenkins-plone-org please run jobs

mauritsvanrees commented 3 years ago

Zope 4.6.2 compared to 4.5.5 updates zope.component from 4.6.2 to 5.0.0. The 2.7 tests completely fail because Products.Archetypes is not compatible with this. Should be fixed with https://github.com/plone/Products.Archetypes/pull/137.

But the Python3 tests fail as well, for example:

File "/home/jenkins/workspace/pull-request-5.2-3.6/src/plone.app.users/plone/app/users/tests/password.rst", line 27, in password.rst
Failed example:
    browser.open('http://nohost/plone/' + view_name)
Expected:
    Traceback (most recent call last):
    ...
    zExceptions.unauthorized.Unauthorized: ...You are not authorized to access this resource...
Got:
    Traceback (most recent call last):
      File "/srv/python3.6/lib/python3.6/doctest.py", line 1330, in __run
        compileflags, 1), test.globs)
      File "<doctest password.rst[8]>", line 1, in <module>
        browser.open('http://nohost/plone/' + view_name)
      File "/home/jenkins/.buildout/eggs/cp36m/zope.testbrowser-5.5.1-py3.6.egg/zope/testbrowser/browser.py", line 256, in open
        self._processRequest(url, make_request)
      File "/home/jenkins/.buildout/eggs/cp36m/zope.testbrowser-5.5.1-py3.6.egg/zope/testbrowser/browser.py", line 282, in _processRequest
        resp = make_request(reqargs)
      File "/home/jenkins/.buildout/eggs/cp36m/zope.testbrowser-5.5.1-py3.6.egg/zope/testbrowser/browser.py", line 253, in make_request
        return self.testapp.get(url, **args)
      File "/home/jenkins/.buildout/eggs/cp36m/WebTest-2.0.35-py3.6.egg/webtest/app.py", line 328, in get
        expect_errors=expect_errors)
      File "/home/jenkins/.buildout/eggs/cp36m/zope.testbrowser-5.5.1-py3.6.egg/zope/testbrowser/browser.py", line 94, in do_request
        expect_errors)
      File "/home/jenkins/.buildout/eggs/cp36m/WebTest-2.0.35-py3.6.egg/webtest/app.py", line 623, in do_request
        res = req.get_response(app, catch_exc_info=True)
      File "/home/jenkins/.buildout/eggs/cp36m/WebOb-1.8.7-py3.6.egg/webob/request.py", line 1310, in send
        application, catch_exc_info=True)
      File "/home/jenkins/.buildout/eggs/cp36m/WebOb-1.8.7-py3.6.egg/webob/request.py", line 1278, in call_application
        app_iter = application(self.environ, start_response)
      File "/home/jenkins/.buildout/eggs/cp36m/WebTest-2.0.35-py3.6.egg/webtest/lint.py", line 201, in lint_app
        iterator = application(environ, start_response_wrapper)
      File "/home/jenkins/.buildout/eggs/cp36m/plone.testing-8.0.3-py3.6.egg/plone/testing/_z2_testbrowser.py", line 39, in wrapped_func
        return func(*args, **kw)
      File "/home/jenkins/.buildout/eggs/cp36m/plone.testing-8.0.3-py3.6.egg/plone/testing/_z2_testbrowser.py", line 66, in __call__
        wsgi_result = publish(environ, start_response)
      File "/home/jenkins/.buildout/eggs/cp36m/Zope-4.6.2-py3.6.egg/ZPublisher/WSGIPublisher.py", line 385, in publish_module
        request.close()
      File "/home/jenkins/.buildout/eggs/cp36m/Zope-4.6.2-py3.6.egg/ZPublisher/BaseRequest.py", line 216, in close
        notify(EndRequestEvent(None, self))
      File "/home/jenkins/.buildout/eggs/cp36m/zope.event-4.5.0-py3.6.egg/zope/event/__init__.py", line 32, in notify
        subscriber(event)
      File "/home/jenkins/.buildout/eggs/cp36m/zope.component-5.0.0-py3.6.egg/zope/component/event.py", line 27, in dispatch
        component_subscribers(event, None)
      File "/home/jenkins/.buildout/eggs/cp36m/zope.component-5.0.0-py3.6.egg/zope/component/_api.py", line 134, in subscribers
        return sitemanager.subscribers(objects, interface)
      File "/home/jenkins/.buildout/eggs/cp36m/zope.interface-5.4.0-py3.6-linux-x86_64.egg/zope/interface/registry.py", line 448, in subscribers
        return self.adapters.subscribers(objects, provided)
      File "/home/jenkins/.buildout/eggs/cp36m/zope.interface-5.4.0-py3.6-linux-x86_64.egg/zope/interface/adapter.py", line 895, in subscribers
        subscriptions = self.subscriptions([providedBy(o) for o in objects], provided)
      File "/home/jenkins/.buildout/eggs/cp36m/zope.interface-5.4.0-py3.6-linux-x86_64.egg/zope/interface/adapter.py", line 877, in _uncached_subscriptions
        if order >= len(byorder):
      File "/home/jenkins/shiningpanda/jobs/8809464e/virtualenvs/0dd3bfc1/lib/python3.6/collections/__init__.py", line 1049, in __len__
        def __len__(self): return len(self.data)
      File "/home/jenkins/.buildout/eggs/cp36m/ZODB-5.6.0-py3.6.egg/ZODB/Connection.py", line 785, in setstate
        raise ConnectionStateError(msg)
    ZODB.POSException.ConnectionStateError: Shouldn't load state for persistent.list.PersistentList 0x19cb2f31a941580b when the connection is closed

This is when visiting @@change-password as anonymous user. When I try it manually, it works: you get redirected to the login form as expected. But a ConnectionStateError in the tests does not sounds good. There are 8 failures, some of them similar to the above.

Maybe they can be fixed. But it makes we wonder if we should stick to the previous zope.component 4.6.2. And maybe stick to zope.interface 4.2.0 as well, instead of upgrading to 4.4.0. (For Plone 6: sure, use the latest.)

Some possible causes of problems are these two issues/PRs:

mauritsvanrees commented 3 years ago

I have pinned zope.component to 4.6.2.

@jenkins-plone-org please run jobs

mauritsvanrees commented 3 years ago

The only failure left (except for one unstable test), is Products.PlonePAS.tests.cookie_auth.rst. That should be fixed when https://github.com/plone/Products.PlonePAS/pull/62 is merged first.

Alternatively, we could pin an older zope.interface, but PlonePAS only has a change in the tests to fix this, so current zope.interface version seems okay.

jensens commented 3 years ago

@jenkins-plone-org please run jobs

mauritsvanrees commented 3 years ago

That should have worked, since you merged the PlonePAS PR. Ah, let me rebase this branch. That should add PlonePAS in the checkouts. Done and force pushed.

@jenkins-plone-org please run jobs

mauritsvanrees commented 3 years ago

It is green!

jamadden commented 3 years ago

I've seen similar ConnectionStateError errors caused by test hygiene issues. Somewhere there's a call to setSiteManager(some_persistent_site), then the connection for that site is closed, but the persistent site manager is left in place. The next time some event gets notified, we try to use some_persistent_site (instead of the global site manager) and explode.

Most likely, this was a lurking issue anyway. It's just that if some_persistent_site itself had already been activated, it wouldn't show up. But now that there are more sub-objects to activate, the odds of a problem are higher. Inserting some calls to flush the ZODB connection cache (for conn in db.pool: conn.cacheMinimize()) can help catch this sooner. If you do it as part of test tearDown, you can often find the offending test pretty quickly.