random failures in unit tests with "AttributeError: 'NoneType' object has no attribute 'keys'"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
Fix Released
|
Undecided
|
Miguel Grinberg |
Bug Description
I occasionally see the following error in unit testing runs:
Traceback (most recent call last):
File "heat/tests/
template = tmpl.HOTemplate
File "heat/engine/
AttributeError: 'NoneType' object has no attribute 'keys'
This occurs in tests that instantiate a specific Template subclass instead of using Template() and letting the system pick the most appropriate class. There are only three tests in the unit testing suite that do this.
The problem is that the Template() constructor accesses the _template_classes global, but this global variable is created the first time the Template() constructor is invoked directly (i.e. not as a result of constructing a subclass). This creates a race condition in the unit testing suite, depending on the order the tests run the global variable may or may not be initialized by the time these three tests get to run.
Changed in heat: | |
milestone: | none → kilo-1 |
status: | Fix Committed → Fix Released |
Changed in heat: | |
milestone: | kilo-1 → 2015.1.0 |
Fix proposed to branch: master /review. openstack. org/137867
Review: https:/