From abb527d1e4ec8ac34f6e277089b59687f9c3307e Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Wed, 20 Nov 2024 15:20:16 +0000 Subject: [PATCH] [OVN] Use the MySQL backend for the ``TestOvnNbSync`` tests The ``TestOvnNbSync`` test cases perform intensive operations on both the Neutron database and the OVN databases. These test are frequently hitting an issue with the Neutron database, that in the functional test is, by default, SQLite. When a port is being deleted, the database raises an exception with the following message: DELETE failed.: oslo_db.exception.DBReferenceError: (sqlite3.IntegrityError) FOREIGN KEY constraint failed [SQL: DELETE FROM ports WHERE ports.id = ?] [parameters: ('64720ac5-72a0-4e88-8193-fd54a97ccef3',)] This resource (port) and the one referring to it (floating IP), have been created and updated in previous API calls, thus the transactions to the database should be commited and finished. This patch is changing the database backend to MySQL, that should provide better transaction isolation. Closes-Bug: #2088423 Change-Id: If1da6c5992aa4635da5a4b5c6eaa06db56d693b4 --- .../ml2/drivers/ovn/mech_driver/ovsdb/test_ovn_db_sync.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovn_db_sync.py b/neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovn_db_sync.py index a31a00923d1..7e23f5139be 100644 --- a/neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovn_db_sync.py +++ b/neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovn_db_sync.py @@ -45,9 +45,11 @@ from neutron.tests.functional import base from neutron.tests.unit.api import test_extensions from neutron.tests.unit.extensions import test_extraroute from neutron.tests.unit.extensions import test_securitygroup +from neutron.tests.unit import testlib_api -class TestOvnNbSync(base.TestOVNFunctionalBase): +class TestOvnNbSync(base.TestOVNFunctionalBase, + testlib_api.MySQLTestCaseMixin): _extension_drivers = ['port_security', 'dns', 'qos', 'revision_plugin']