Sometimes, the test suite fails with a AssertionError: No matching class found for... error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenERP Connector |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Steps to reproduce:
Launch the test suite of the 'connector' module.
I'm using the buildout, so that's bin/rununittests -m connector
Most of the times, it's all green, but sometimes I an error like the following on some tests:
=======
FAIL: test_get_
Returns the replacing ConnectorUnit
-------
Traceback (most recent call last):
File "/home/
'res.users')
File "/home/
(base_class, session, model_name))
AssertionError: No matching class found for <class 'openerp.
This seems to be related to the initialization of the registry, which does not populate it with the models.
I couldn't find the exact cause, but it occurs in the WorkerWatcher, because it starts probably before OpenERP could finish the initialization of the registry.
In the code below, the line "dbworker_obj = session.
def check_alive(self, db_name, worker):
""" Check if the the worker is still alive and notify
its aliveness.
Check if the other workers are still alive, if they are
dead, remove them from the worker's pool.
"""
session_hdl = ConnectorSessio
with session_
if worker.is_alive():
def _notify_alive(self, session, worker):
# at startup (especially when running tests),
# registry is not yet initialized, so we just skip
# the notify in such case
if not dbworker_obj:
return
If I put a delay before the start of the WorkerWatcher, the error does no longer appears, but that's not a correct solution though.
Changed in openerp-connector: | |
status: | New → Confirmed |
information type: | Embargoed → Public |
Changed in openerp-connector: | |
status: | Confirmed → Fix Released |
Here is the cause of the bug: https:/ /bugs.launchpad .net/openobject -server/ +bug/1238560 /code.launchpad .net/~camptocam p/openobject- server/ 7.0-registryman ager-rlock- 1238560- gbr/+merge/ 190570
And my proposal: https:/
Note that once fixed, we can safely remove the lines:
# at startup (especially when running tests),
# registry is not yet initialized, so we just skip
# the notify in such case
if not dbworker_obj:
return