commit dc911b8026a5cf949ca5a697bb802c495dc9ada2
Author: Matt Riedemann <email address hidden>
Date: Thu Dec 29 12:17:10 2016 -0500
Fix assertion in test_instance_fault_get_by_instance
The instance_fault_get_by_instance_uuids DB API method returns
results sorted by created_at in descending order, so the newest
fault should be at the front of the list for a given instance
uuid in the resulting dict.
However, the way the test for this was written the 'expected'
list actually had the faults in order from oldest to newest. The
reason this didn't fail the test was because it was using
_assertEqualListsOfObjects to compare the results, which sorts
the lists before comparing them, which is exactly NOT what we want
when we care about the sort order of the results.
The test is fixed by using _assertEqualOrderedListOfObjects which
leaves the original sort order of the lists to compare and fixes
the 'expected' list by inserting the newest faults at the front
of the list.
Reviewed: https:/ /review. openstack. org/415736 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=dc911b8026a 5cf949ca5a697bb 802c495dc9ada2
Committed: https:/
Submitter: Jenkins
Branch: master
commit dc911b8026a5cf9 49ca5a697bb802c 495dc9ada2
Author: Matt Riedemann <email address hidden>
Date: Thu Dec 29 12:17:10 2016 -0500
Fix assertion in test_instance_ fault_get_ by_instance
The instance_ fault_get_ by_instance_ uuids DB API method returns
results sorted by created_at in descending order, so the newest
fault should be at the front of the list for a given instance
uuid in the resulting dict.
However, the way the test for this was written the 'expected' lListsOfObjects to compare the results, which sorts
list actually had the faults in order from oldest to newest. The
reason this didn't fail the test was because it was using
_assertEqua
the lists before comparing them, which is exactly NOT what we want
when we care about the sort order of the results.
The test is fixed by using _assertEqualOrd eredListOfObjec ts which
leaves the original sort order of the lists to compare and fixes
the 'expected' list by inserting the newest faults at the front
of the list.
Change-Id: I58990194016447 b05b42df76141a1 93595cdcb9c
Related-Bug: #1632247