Comment 8 for bug 1521599

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

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

commit 94b40cf43ca3ab7d85fd15c8fda9baf8ed07f8a1
Author: Markus Zoeller <email address hidden>
Date: Fri May 6 16:16:54 2016 +0200

    Fix TestNeutronv2.test_deallocate_for_instance_2* race failures

    The unit tests
        test_deallocate_for_instance_2_with_requested
        test_deallocate_for_instance_2
    in
        nova.tests.unit.network.test_neutronv2.TestNeutronv2
    fail randomly. An example error looks like this:

        b'mox3.mox.UnexpectedMethodCallError: Unexpected method call.
        unexpected:- expected:+'
        b"- Client.delete_port('my_portid1') -> None"
        b'? ^'
        b"+ Client.delete_port('my_portid2') -> None"
        b'?

    This is due to the mox record with expected the deletion of multiple
    ports on an instance in a specific order. This order is not important
    though and also not the same in each test case execution. To make it
    explicit in the test case, that the order is *not* important, I've
    chosen to define that in the mock records with "InAnyOrder()".

    Another solution could have been to ensure the order of the port IDs
    through the unit tests, but that could be interpreted as a precondition
    for the functional code to work correctly, which is a wrong assumption
    and therefore not chosen for this fix.

    Closes-Bug: 1521599

    Change-Id: I6ee4512d221aed48ee56f6cca19744f20f70cbe0