Ticket #1848 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

All functional tests break with error message "TypeError: Can't pickle objects in acquisition wrappers"

Reported by: madarche Assigned to: madarche
Priority: P2 Milestone: CPS 3.4.5
Component: CPS (global) Version: TRUNK
Severity: normal Keywords:
Cc:

Description

All functional tests relying on the CPSTestCase.CPSDefaultLayer ends with the following error message:

  Set up Products.CPSDefault.tests.CPSTestCase.CPSDefaultLayer <SubscriberDef at /portal/portal_eventservice/event_recorder>
Traceback (most recent call last):
  File "/usr/local/zope/2.9.7/bin/test.py", line 117, in ?
    sys.exit(testrunner.run(defaults))
  File "/usr/local/zope/2.9.7/lib/python/zope/testing/testrunner.py", line 271, in run
    failed = not run_with_options(options)
  File "/usr/local/zope/2.9.7/lib/python/zope/testing/testrunner.py", line 433, in run_with_options
    setup_layers, failures, errors)
  File "/usr/local/zope/2.9.7/lib/python/zope/testing/testrunner.py", line 604, in run_layer
    setup_layer(layer, setup_layers)
  File "/usr/local/zope/2.9.7/lib/python/zope/testing/testrunner.py", line 692, in setup_layer
    layer.setUp()
  File "/usr/local/zope/instance/cps/Products/CPSDefault/tests/CPSTestCase.py", line 152, in setUp
    self.install()
  File "/usr/local/zope/instance/cps/Products/CPSDefault/tests/CPSTestCase.py", line 178, in install
    transaction.commit()
  File "/usr/local/zope/2.9.7/lib/python/transaction/_manager.py", line 96, in commit
    return self.get().commit(sub, deprecation_wng=False)
  File "/usr/local/zope/instance/cps/Products/CPSCompat/PatchZODBTransaction.py", line 175, in commit
    self._commitResources()
  File "/usr/local/zope/2.9.7/lib/python/transaction/_transaction.py", line 433, in _commitResources
    rm.commit(self)
  File "/usr/local/zope/2.9.7/lib/python/ZODB/Connection.py", line 484, in commit
    self._commit(transaction)
  File "/usr/local/zope/2.9.7/lib/python/ZODB/Connection.py", line 526, in _commit
    self._store_objects(ObjectWriter(obj), transaction)
  File "/usr/local/zope/2.9.7/lib/python/ZODB/Connection.py", line 553, in _store_objects
    p = writer.serialize(obj)  # This calls __getstate__ of obj
  File "/usr/local/zope/2.9.7/lib/python/ZODB/serialize.py", line 412, in serialize
    return self._dump(meta, obj.__getstate__())
TypeError: Can't pickle objects in acquisition wrappers.

What is strange is that it does not happen on all machines and seems to only happen on faster machines.

Change History

06/26/07 09:55:59 changed by madarche

  • status changed from new to closed.
  • resolution set to fixed.

Fixed by changeset [51875].

The problem was caused by the EventRecorder? class in source:CPS3/products/CPSDefault/trunk/tests/CPSTestCase.py#51072 which was committing events in the ZODB.

The solution has been to use a volatile variable (self._v_events instead of self._events) to store the events.