From 1e41558851b7e561e1dcf99499e6f7920a91fa72 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Sat, 18 Feb 2023 05:16:35 +0100 Subject: [PATCH] Reduce number of routers created in ``test_gateway_chassis_rebalance`` This patch reduces the number of routers created in ``test_gateway_chassis_rebalance``. For the test purposes, 5 routers is enough, reduce the test executing time and the OVN load. This patch also captures the "Port_Binding" update event in the ``WaitForCrLrpPortBindingEvent`` class. Related-Bug: #2007353 Change-Id: I66b39b1d0dccfbb18bec5646d8954eee8c687f0c --- neutron/tests/functional/resources/ovsdb/events.py | 2 +- neutron/tests/functional/services/ovn_l3/test_plugin.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/neutron/tests/functional/resources/ovsdb/events.py b/neutron/tests/functional/resources/ovsdb/events.py index 960f46528c4..a0a81bf142f 100644 --- a/neutron/tests/functional/resources/ovsdb/events.py +++ b/neutron/tests/functional/resources/ovsdb/events.py @@ -30,7 +30,7 @@ class WaitForCrLrpPortBindingEvent(event.RowEvent): self.logical_port_events = collections.defaultdict(threading.Event) self.timeout = timeout super(WaitForCrLrpPortBindingEvent, self).__init__( - (self.ROW_CREATE,), 'Port_Binding', None) + (self.ROW_CREATE, self.ROW_UPDATE), 'Port_Binding', None) def match_fn(self, event, row, old=None): return row.logical_port.startswith(self.PREFIX) diff --git a/neutron/tests/functional/services/ovn_l3/test_plugin.py b/neutron/tests/functional/services/ovn_l3/test_plugin.py index 9085682c9d5..64f67d0ed06 100644 --- a/neutron/tests/functional/services/ovn_l3/test_plugin.py +++ b/neutron/tests/functional/services/ovn_l3/test_plugin.py @@ -541,9 +541,9 @@ class TestRouter(base.TestOVNFunctionalBase): ext1 = self._create_ext_network( 'ext1', 'flat', 'physnet4', None, "30.0.0.1", "30.0.0.0/24") gw_info = {'network_id': ext1['network']['id']} - # Tries to create 20 routers with a gateway. Since we're using + # Tries to create 5 routers with a gateway. Since we're using # physnet4, the chassis candidates will be chassis4 initially. - num_routers = 20 + num_routers = 5 for i in range(num_routers): try: router = self._create_router('router%d' % i, gw_info=gw_info)