[FT] Add a timeout for the NB/SB connection stop method

If the DB connection is not stopped at the defined timeout (10 seconds),
the clean-up process will continue.

Closes-Bug: #2034589
Change-Id: I6c3b4da49364c3fed86053515e79121acac078d6
(cherry picked from commit b40c728cbb)
This commit is contained in:
Rodolfo Alonso Hernandez 2024-07-05 08:35:24 +00:00 committed by yatin
parent 4807ed8936
commit 45318c2c2f

View File

@ -379,8 +379,12 @@ class TestOVNFunctionalBase(test_plugin.Ml2PluginV2TestCase,
if self.maintenance_worker: if self.maintenance_worker:
self.mech_driver.nb_synchronizer.stop() self.mech_driver.nb_synchronizer.stop()
self.mech_driver.sb_synchronizer.stop() self.mech_driver.sb_synchronizer.stop()
self.mech_driver.nb_ovn.ovsdb_connection.stop() for ovn_conn in (self.mech_driver.nb_ovn.ovsdb_connection,
self.mech_driver.sb_ovn.ovsdb_connection.stop() self.mech_driver.sb_ovn.ovsdb_connection):
try:
ovn_conn.stop(timeout=10)
except Exception: # pylint:disable=bare-except
pass
def restart(self): def restart(self):
self.stop() self.stop()