Comment 35 for bug 1348818

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/112258
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=f103ce48ca60e12952be7aa6d5183f64ef826370
Submitter: Jenkins
Branch: master

commit f103ce48ca60e12952be7aa6d5183f64ef826370
Author: Sam Betts <email address hidden>
Date: Wed Aug 6 00:05:05 2014 +0100

    Predictable field and filter ordering

    This fixes the fields and filters units tests that break with a
    randomized PYTHONHASHSEED (see the bug report).

    The RESOURCE_ATTRIBUTE_MAP is stored as a dict leading to an
    unpredictable output order. Values in kvp strings are being stored as
    sets underpinned by dicts when converted, leading to unpredictable
    ordering of values when read.

    Discovered with PYTHONHASHSEED = 2455351445 on these tests:
    test_api_v2.APIv2TestCase.test_fields
    test_api_v2.APIv2TestCase.test_fields_multiple
    test_api_v2.FiltersTestCase.test_attr_info_with_convert_list_to
    test_api_v2.APIv2TestCase.test_filters_with_fields
    test_api_v2.APIv2TestCase.test_fields_multiple_with_empty

    There are 3 parts to this fix:
    1. Update the APIv2TestCase _do_field_list function to construct
    field list in the same order as the controller constructs its list.
    2. Ensure the APIv2TestCase _get_collection_kwargs maintains order
    throughout.
    3. Use new assertOrderedEqual function to sort values before assertion
    in test_attr_info_with_convert_list_to

    Change-Id: I547cfa80cf83b0340b459279df9283443562326b
    Partial-bug: #1348818