TestObjEqualPrims.test_object_not_equal is failing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
High
|
Paul Murray |
Bug Description
For some reason not yet identified, local master branches fail with this check
=======
FAIL: nova.tests.
-------
Traceback (most recent call last):
testtools.
pythonlogging:''
stderr
stdout
Traceback (most recent call last):
File "nova/tests/
"Objects that differ in any field "
File "/home/
raise self.failureExc
AssertionError: True is not false : Objects that differ in any field should not be equal
but Jenkins py27 seems to be fine, with LogStash silent :
http://
A git bisect shows d95c05a8fd2f762
Changed in nova: | |
milestone: | none → liberty-1 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | liberty-1 → 12.0.0 |
I stepped through the test in a debugger and found that the name managling for the object fields was not happening as they were set. So e.g.
obj1 = MyObj(foo=1, bar='goodbye')
creates an object with the fields stored as: foo and bar
The test code converts the objects to primitives and then compares the primitives. The calls to obj_to_primitve() return:
prim1 = {'nova_ object. version' : '1.6', 'nova_object.name': 'MyObj', 'nova_object.data': {}, 'nova_object. namespace' : 'nova'} object. version' : '1.6', 'nova_object.name': 'MyObj', 'nova_object.data': {}, 'nova_object. namespace' : 'nova'}
prim2 = {'nova_
This is because the getter on the objects is using the _obj_ prefix on the names when looking up the data fields, but they were saved by the setter without those prefixes, so they are not found.
The setter and getter code is added by the object metaclass - so something is going wrong there.
The commit d95c05a8fd2f762 765408b9cf84da7 c8d34a7892 identified above changes the metaclass.
Note: this is not happening in CI checks on jenkins, only on local test runs - so something environmental?