CI: Fix race prone unit test in networking

In the networking code stack, one of the methods
looks to identify if a change has occured, except
some of the other tests utilize the same value that
was previously asserted for the same base object.

Becaues of this, just use a unique value so we
don't risk the possibility of the test failing
erroneously.

Change-Id: Ide2b205ade67a4090a0b9bfe1282d01f7605ceb9
This commit is contained in:
Julia Kreger 2023-01-18 10:56:51 -08:00
parent 571d0223ba
commit 9a85e4787b
1 changed files with 3 additions and 1 deletions

View File

@ -1086,7 +1086,9 @@ class TestNeutronVifPortIDMixin(db_base.DbTestCase):
autospec=True)
def test_port_changed_client_id_fail(self, dhcp_update_mock):
self.port.internal_info = {'tenant_vif_port_id': 'fake-id'}
self.port.extra = {'client-id': 'fake2'}
self.port.extra = {'client-id': 'fake3'}
# NOTE(TheJulia): Does not save, because it attempts to figure
# out what has changed as part of the test.
dhcp_update_mock.side_effect = (
exception.FailedToUpdateDHCPOptOnPort(port_id=self.port.uuid))
with task_manager.acquire(self.context, self.node.id) as task: