diff --git a/neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovn_db_resources.py b/neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovn_db_resources.py index 241677e9375..aeb5c084b25 100644 --- a/neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovn_db_resources.py +++ b/neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovn_db_resources.py @@ -24,6 +24,7 @@ from ovsdbapp.backend.ovs_idl import idlutils from neutron.common.ovn import constants as ovn_const from neutron.common.ovn import utils +from neutron.common import utils as n_utils from neutron.conf.plugins.ml2.drivers.ovn import ovn_conf as ovn_config from neutron.tests.functional import base @@ -31,6 +32,13 @@ from neutron.tests.functional import base class TestNBDbResources(base.TestOVNFunctionalBase): _extension_drivers = ['dns'] + def _is_nb_global_ready(self): + try: + next(iter(self.nb_api.tables['NB_Global'].rows)) + except StopIteration: + return False + return True + def setUp(self): super(TestNBDbResources, self).setUp() self.orig_get_random_mac = n_net.get_random_mac @@ -40,6 +48,12 @@ class TestNBDbResources(base.TestOVNFunctionalBase): group='ovn') ovn_config.cfg.CONF.set_override('dns_domain', 'ovn.test') + # Wait for NB_Global table, for details see: LP #1956965 + n_utils.wait_until_true( + self._is_nb_global_ready, + timeout=15, sleep=1 + ) + # FIXME(lucasagomes): Map the revision numbers properly instead # of stripping them out. Currently, tests like test_dhcp_options() # are quite complex making it difficult to map the exact the revision