Comment 7 for bug 1632247

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

Reviewed: https://review.openstack.org/415736
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=dc911b8026a5cf949ca5a697bb802c495dc9ada2
Submitter: Jenkins
Branch: master

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.

    Change-Id: I58990194016447b05b42df76141a193595cdcb9c
    Related-Bug: #1632247