A bad _RC_CACHE can rarely cause unit tests to fail
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
Chris Dent |
Bug Description
Very rarely (so rarely in fact that it only seems to happen when test order is much different from the norm) some unit tests which encounter the resource_
http://
-=-=-
ft1.1: nova.tests.
Traceback (most recent call last):
File "nova/tests/
self.
File "nova/tests/
rp.
File "nova/api/
exceeded = _set_inventory(
File "/home/
return fn(*args, **kwargs)
File "nova/api/
_add_
File "nova/api/
if inv_record.capacity <= 0:
AttributeError: 'NoneType' object has no attribute 'capacity'
-=-=-
The find() method on InventoryList can return None if that cache is bad.
This can be resolved (apparently) by resetting the _RC_CACHE between test runs in the same way that _TRAITS_SYNCED is reset, in nova/test.py:
- # Reset the traits sync flag
- objects.
+ # Reset the traits sync flag and rc cache
+ resource_
+ resource_
Fix proposed to branch: master /review. openstack. org/540404
Review: https:/