From 9a85e4787b9f7256ccd09ea293b89509666b88c7 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Wed, 18 Jan 2023 10:56:51 -0800 Subject: [PATCH] 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 --- ironic/tests/unit/drivers/modules/network/test_common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ironic/tests/unit/drivers/modules/network/test_common.py b/ironic/tests/unit/drivers/modules/network/test_common.py index 555024216d..7b907ad225 100644 --- a/ironic/tests/unit/drivers/modules/network/test_common.py +++ b/ironic/tests/unit/drivers/modules/network/test_common.py @@ -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: