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:
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.
Reviewed: https:/ /review. openstack. org/313574 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=94b40cf43ca 3ab7d85fd15c8fd a9baf8ed07f8a1
Committed: https:/
Submitter: Jenkins
Branch: master
commit 94b40cf43ca3ab7 d85fd15c8fda9ba f8ed07f8a1
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_deallocat e_for_instance_ 2_with_ requested
test_deallocat e_for_instance_ 2
nova.tests. unit.network. test_neutronv2. TestNeutronv2
in
fail randomly. An example error looks like this:
b"- Client.
b'? ^'
b"+ Client.
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: I6ee4512d221aed 48ee56f6cca1974 4f20f70cbe0