plone/buildout.jenkins

ConnectionStateError when run testing with 'bin/jenkins-test'

Closed this issue · 2 comments

If you have a product product.one with the profile with registry.xml file:

<?xml version="1.0"?>
<registry>
    <records interface="product.one.interfaces.IProductOneSettings" />
</registry>

And class product.one.interfaces.IProductOneSettings:

from z3c.form import interfaces
from zope.interface import Interface
from zope import schema
from plone.registry import field

from product.one import _

class IProductOneSettings(Interface):
    """
    """

    templates = schema.List(title=_(u"Templates Captcha"),
                            description=_(u"help_templates",
                                                default=u"Templates in which the"
                            " captcha does not appear until two errors occur."),
                             required=False,
                             default=['login',
                                      'login_form',
                                      'login_failed',
                                      'logged_out'],
                            value_type=field.TextLine(title=u"Value"))

When we have two other products (product.two and product.three) that have how dependency the product.one in metadata.xml, and put these two products in jenkins-test-eggs:

[buildout]
extends =
    https://raw.github.com/plone/buildout.jenkins/master/jenkins.cfg

jenkins-test-eggs = 
   product.two
   product.three

Running 'bin/jenkins-test', the tests of product.two occur without problem. But when will install the profile of product.three to begin running the tests of product.three, the error ConnectionStateError occurs. But specifically when installing the registry.xml file of produtc.one (which is dependency)

I found that the problem is the value_type in field 'templates' of product.one.interfaces.IProductOneSettings. Without value_type, test work.

Leaving only product.two or only product.three in jenkins-test-eggs, the tests also work.

I'm using the plone.app.testing.

The complete log:

Running serpro.manualsadipem.testing.ManualSadipem:Functional tests:
  Set up plone.testing.zca.LayerCleanup in 0.000 seconds.
  Set up plone.testing.z2.Startup in 0.176 seconds.
  Set up plone.app.testing.layers.PloneFixture in 7.478 seconds.
  Set up serpro.manualsadipem.testing.ManualSadipem in 8.438 seconds.
  Set up serpro.manualsadipem.testing.ManualSadipem:Functional in 0.000 seconds.
  Running:

  Ran 12 tests with 0 failures and 0 errors in 1.397 seconds.
Running serpro.manualsadipem.testing.ManualSadipem:Integration tests:
  Tear down serpro.manualsadipem.testing.ManualSadipem:Functional in 0.000 seconds.
  Set up serpro.manualsadipem.testing.ManualSadipem:Integration in 0.000 seconds.
  Running:

  Ran 1 tests with 0 failures and 0 errors in 0.111 seconds.
Running serpro.manualsiafi.testing.ManualSiafi:Functional tests:
  Tear down serpro.manualsadipem.testing.ManualSadipem:Integration in 0.000 seconds.
  Tear down serpro.manualsadipem.testing.ManualSadipem in 0.003 seconds.
  Set up serpro.manualsiafi.testing.ManualSiafi Traceback (most recent call last):
  File "/rede/jenkins/cache-mirror-serpro/eggs/zope.testrunner-4.1.1-py2.7.egg/zope/testrunner/runner.py", line 380, in run_layer
    setup_layer(options, layer, setup_layers)
  File "/rede/jenkins/cache-mirror-serpro/eggs/zope.testrunner-4.1.1-py2.7.egg/zope/testrunner/runner.py", line 667, in setup_layer
    setup_layer(options, base, setup_layers)
  File "/rede/jenkins/cache-mirror-serpro/eggs/zope.testrunner-4.1.1-py2.7.egg/zope/testrunner/runner.py", line 672, in setup_layer
    layer.setUp()
  File "/rede/jenkins/cache-mirror-serpro/eggs/plone.app.testing-4.2.4-py2.7.egg/plone/app/testing/helpers.py", line 343, in setUp
    self.setUpPloneSite(portal)
  File "/home/05232887602/workspaces/manualstn/serpro.manualsiafi/serpro/manualsiafi/testing.py", line 38, in setUpPloneSite
    applyProfile(portal, 'serpro.manualsiafi:default')
  File "/rede/jenkins/cache-mirror-serpro/eggs/plone.app.testing-4.2.4-py2.7.egg/plone/app/testing/helpers.py", line 113, in applyProfile
    setupTool.runAllImportStepsFromProfile(profileId)
  File "/rede/jenkins/cache-mirror-serpro/eggs/Products.GenericSetup-1.7.5-py2.7.egg/Products/GenericSetup/tool.py", line 365, in runAllImportStepsFromProfile
    blacklisted_steps=blacklisted_steps)
   - __traceback_info__: profile-serpro.manualsiafi:default
  File "/rede/jenkins/cache-mirror-serpro/eggs/Products.GenericSetup-1.7.5-py2.7.egg/Products/GenericSetup/tool.py", line 1119, in _runImportStepsFromContext
    message = self._doRunImportStep(step, context)
  File "/rede/jenkins/cache-mirror-serpro/eggs/Products.GenericSetup-1.7.5-py2.7.egg/Products/GenericSetup/tool.py", line 1030, in _doRunImportStep
    return handler(context)
   - __traceback_info__: plone.app.registry
  File "/rede/jenkins/cache-mirror-serpro/eggs/plone.app.registry-1.2.3-py2.7.egg/plone/app/registry/exportimport/handler.py", line 49, in importRegistry
    importer.importDocument(body)
  File "/rede/jenkins/cache-mirror-serpro/eggs/plone.app.registry-1.2.3-py2.7.egg/plone/app/registry/exportimport/handler.py", line 94, in importDocument
    self.importRecords(node)
  File "/rede/jenkins/cache-mirror-serpro/eggs/plone.app.registry-1.2.3-py2.7.egg/plone/app/registry/exportimport/handler.py", line 307, in importRecords
    self.context.registerInterface(interface, omit=tuple(omit), prefix=prefix)
  File "/rede/jenkins/cache-mirror-serpro/eggs/plone.registry-1.0.2-py2.7.egg/plone/registry/registry.py", line 92, in registerInterface
    persistent_field = queryAdapter(field, IPersistentField)
  File "/rede/jenkins/cache-mirror-serpro/eggs/zope.component-3.9.5-py2.7.egg/zope/component/_api.py", line 102, in queryAdapter
    return adapter_hook(interface, object, name, default)
  File "/rede/jenkins/cache-mirror-serpro/eggs/zope.component-3.9.5-py2.7.egg/zope/component/hooks.py", line 104, in adapter_hook
    return siteinfo.adapter_hook(interface, object, name, default)
  File "/rede/jenkins/cache-mirror-serpro/eggs/plone.registry-1.0.2-py2.7.egg/plone/registry/fieldfactory.py", line 45, in persistentFieldAdapter
    if v is not None and v != context.missing_value:
  File "/rede/jenkins/cache-mirror-serpro/eggs/zope.schema-4.2.2-py2.7.egg/zope/schema/_bootstrapfields.py", line 205, in __ne__
    return not self.__eq__(other)
  File "/rede/jenkins/cache-mirror-serpro/eggs/ZODB3-3.10.5-py2.7-linux-i686.egg/ZODB/Connection.py", line 857, in setstate
    raise ConnectionStateError(msg)
ConnectionStateError: Shouldn't load state for 0x090e357a22636cc2 when the connection is closed

Running serpro.manualsiafi.testing.ManualSiafi:Integration tests:
  Set up serpro.manualsiafi.testing.ManualSiafi Traceback (most recent call last):
  File "/rede/jenkins/cache-mirror-serpro/eggs/zope.testrunner-4.1.1-py2.7.egg/zope/testrunner/runner.py", line 380, in run_layer
    setup_layer(options, layer, setup_layers)
  File "/rede/jenkins/cache-mirror-serpro/eggs/zope.testrunner-4.1.1-py2.7.egg/zope/testrunner/runner.py", line 667, in setup_layer
    setup_layer(options, base, setup_layers)
  File "/rede/jenkins/cache-mirror-serpro/eggs/zope.testrunner-4.1.1-py2.7.egg/zope/testrunner/runner.py", line 672, in setup_layer
    layer.setUp()
  File "/rede/jenkins/cache-mirror-serpro/eggs/plone.app.testing-4.2.4-py2.7.egg/plone/app/testing/helpers.py", line 343, in setUp
    self.setUpPloneSite(portal)
  File "/home/05232887602/workspaces/manualstn/serpro.manualsiafi/serpro/manualsiafi/testing.py", line 38, in setUpPloneSite
    applyProfile(portal, 'serpro.manualsiafi:default')
  File "/rede/jenkins/cache-mirror-serpro/eggs/plone.app.testing-4.2.4-py2.7.egg/plone/app/testing/helpers.py", line 113, in applyProfile
    setupTool.runAllImportStepsFromProfile(profileId)
  File "/rede/jenkins/cache-mirror-serpro/eggs/Products.GenericSetup-1.7.5-py2.7.egg/Products/GenericSetup/tool.py", line 365, in runAllImportStepsFromProfile
    blacklisted_steps=blacklisted_steps)
   - __traceback_info__: profile-serpro.manualsiafi:default
  File "/rede/jenkins/cache-mirror-serpro/eggs/Products.GenericSetup-1.7.5-py2.7.egg/Products/GenericSetup/tool.py", line 1119, in _runImportStepsFromContext
    message = self._doRunImportStep(step, context)
  File "/rede/jenkins/cache-mirror-serpro/eggs/Products.GenericSetup-1.7.5-py2.7.egg/Products/GenericSetup/tool.py", line 1030, in _doRunImportStep
    return handler(context)
   - __traceback_info__: plone.app.registry
  File "/rede/jenkins/cache-mirror-serpro/eggs/plone.app.registry-1.2.3-py2.7.egg/plone/app/registry/exportimport/handler.py", line 49, in importRegistry
    importer.importDocument(body)
  File "/rede/jenkins/cache-mirror-serpro/eggs/plone.app.registry-1.2.3-py2.7.egg/plone/app/registry/exportimport/handler.py", line 94, in importDocument
    self.importRecords(node)
  File "/rede/jenkins/cache-mirror-serpro/eggs/plone.app.registry-1.2.3-py2.7.egg/plone/app/registry/exportimport/handler.py", line 307, in importRecords
    self.context.registerInterface(interface, omit=tuple(omit), prefix=prefix)
  File "/rede/jenkins/cache-mirror-serpro/eggs/plone.registry-1.0.2-py2.7.egg/plone/registry/registry.py", line 92, in registerInterface
    persistent_field = queryAdapter(field, IPersistentField)
  File "/rede/jenkins/cache-mirror-serpro/eggs/zope.component-3.9.5-py2.7.egg/zope/component/_api.py", line 102, in queryAdapter
    return adapter_hook(interface, object, name, default)
  File "/rede/jenkins/cache-mirror-serpro/eggs/zope.component-3.9.5-py2.7.egg/zope/component/hooks.py", line 104, in adapter_hook
    return siteinfo.adapter_hook(interface, object, name, default)
  File "/rede/jenkins/cache-mirror-serpro/eggs/plone.registry-1.0.2-py2.7.egg/plone/registry/fieldfactory.py", line 45, in persistentFieldAdapter
    if v is not None and v != context.missing_value:
  File "/rede/jenkins/cache-mirror-serpro/eggs/zope.schema-4.2.2-py2.7.egg/zope/schema/_bootstrapfields.py", line 205, in __ne__
    return not self.__eq__(other)
  File "/rede/jenkins/cache-mirror-serpro/eggs/ZODB3-3.10.5-py2.7-linux-i686.egg/ZODB/Connection.py", line 857, in setstate
    raise ConnectionStateError(msg)
ConnectionStateError: Shouldn't load state for 0x090e357a22636cc2 when the connection is closed

@hvelarde I saw somewhere that you have come across the ConnectionStateError, relating to the plone.registry. You can help here?

There was no activity on this for a while. I close this request for now. If you plan to work further on this please reopen and go on.