From ccd6c3875eaec3978fbe970e11d04db8a3c29b0c Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Wed, 15 Apr 2020 10:01:03 -0700 Subject: [PATCH] Disable two tests due to sqlalchemy/sqlite bug This patch adds a test skip for two tests that are impacted by the recent sqlalchemy 1.3.16 release. With this release, a patch[1], changes the default commit behavior of a transaction. With this change we are seeing that the load balancer created in the tree-create test disappears from the transaction context during the test and the pool create call will throw a foreign key error as the load balancer is not in the database. It's not clear if this is purely a sqlalchemy, pysqlite, or sqlite3 bug at this time. Given the requirements are already in freeze for the Ussuri release, we are opting to disable the tests (we know only sqlite is impacted), instead of attempt to blacklist 1.3.16 in requirements. [1] https://github.com/sqlalchemy/sqlalchemy/commit/9ebbf8614a24fbc430365f6e76c9fd04616992fa#diff-e9762e21a27d8e6c44db6f9dd4edc694R455 Change-Id: I7910ebe4cff692bab67349bbf3e4ee4e24b5fa7a --- octavia/tests/functional/db/test_repositories.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/octavia/tests/functional/db/test_repositories.py b/octavia/tests/functional/db/test_repositories.py index ceb73070a4..6a6043c1c1 100644 --- a/octavia/tests/functional/db/test_repositories.py +++ b/octavia/tests/functional/db/test_repositories.py @@ -426,6 +426,11 @@ class AllRepositoriesTest(base.OctaviaDBTestBase): self.assertEqual(pool, pool_dm_dict) def test_create_load_balancer_tree(self): + self.skipTest("SLQAlchemy/PySqlite transaction handling is broken. " + "Version 1.3.16 of sqlachemy changes how sqlite3 " + "transactions are handled and this test fails as " + "The LB created early in this process now disappears " + "from the transaction context.") project_id = uuidutils.generate_uuid() member = {'project_id': project_id, 'ip_address': '11.0.0.1', 'protocol_port': 80, 'enabled': True, 'backup': False, @@ -505,6 +510,11 @@ class AllRepositoriesTest(base.OctaviaDBTestBase): self.assertIsInstance(db_lb, models.LoadBalancer) def test_sqlite_transactions_broken(self): + self.skipTest("SLQAlchemy/PySqlite transaction handling is broken. " + "Version 1.3.16 of sqlachemy changes how sqlite3 " + "transactions are handled and this test fails as " + "The LB created early in this process now disappears " + "from the transaction context.") """This test is a canary for pysqlite fixing transaction handling. When this test starts failing, we can fix and un-skip the deadlock