_compare_results incorrectly reports extra list items when items in lists don't match
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Confirmed
|
Medium
|
Vishakha Agarwal |
Bug Description
I discovered this bug while refactoring functional tests. This happens in the current Nova master.
The _compare_results function is defined in nova/tests/
To reproduce, pass two lists to _compare_results that are the same length but have one item not equal.
list1 = [{u'foo': u'bar', u'bar': u'baz'}]
list2 = [{u'foo': u'baz', u'bar': u'baz'}]
_compare_results returns the following:
nova.tests.
{u'foo': u'bar', u'bar': u'baz'}
Extra list items in Test:
{u'foo': u'baz', u'bar': u'baz'}
While this is "technically" accurate, it's really hard to debug if you can imagine a lengthy, nested json file dumped into that response.
_compare_results is already checking each item in the list, it should just be returning a list of keys that don't match, not the whole thing!
Changed in nova: | |
status: | Confirmed → In Progress |
Changed in nova: | |
status: | In Progress → Confirmed |
Changed in nova: | |
assignee: | nobody → Prateek Arora (parora) |
Changed in nova: | |
status: | Confirmed → In Progress |
Changed in nova: | |
status: | In Progress → Confirmed |
assignee: | Prateek Arora (parora) → nobody |
Changed in nova: | |
assignee: | nobody → Vishakha Agarwal (vishakha.agarwal) |
Auggy,
Are you working on the fix? Please change status to Inprogress if you are, otherwise change Assigned to ->nobody.