[oslo.db][Zaqar] test_models_sync failed because oslo.db raise "AttributeError: can't set attribute"

Ben Nemec openstack at nemebean.com
Thu Mar 25 15:03:44 UTC 2021



On 3/25/21 3:29 AM, hao wang wrote:
> Hi,
> There is an  issue about test_models_sync test when
> openstack-tox-lower-constraints job running that I can't figure out
> why it's here, could anyone help me about this?
> 
>   zaqar.tests.unit.storage.sqlalchemy_migration.test_migrations.TestMigrationsMySQL.test_models_sync
> [0.306333s] ... FAILED
> 
> Captured traceback:
> ~~~~~~~~~~~~~~~~~~~
>      Traceback (most recent call last):
> 
>        File "/home/zuul/src/opendev.org/openstack/zaqar/.tox/lower-constraints/lib/python3.8/site-packages/oslo_db/sqlalchemy/test_base.py",
> line 178, in setUp
>      self.useFixture(
> 
>        File "/home/zuul/src/opendev.org/openstack/zaqar/.tox/lower-constraints/lib/python3.8/site-packages/testtools/testcase.py",
> line 760, in useFixture
>      reraise(*exc_info)
> 
>        File "/home/zuul/src/opendev.org/openstack/zaqar/.tox/lower-constraints/lib/python3.8/site-packages/testtools/_compat3x.py",
> line 16, in reraise
>      raise exc_obj.with_traceback(exc_tb)
> 
>        File "/home/zuul/src/opendev.org/openstack/zaqar/.tox/lower-constraints/lib/python3.8/site-packages/testtools/testcase.py",
> line 735, in useFixture
>      fixture.setUp()
> 
>        File "/home/zuul/src/opendev.org/openstack/zaqar/.tox/lower-constraints/lib/python3.8/site-packages/oslo_db/sqlalchemy/test_base.py",
> line 65, in setUp
>      testresources.setUpResources(
> 
>        File "/home/zuul/src/opendev.org/openstack/zaqar/.tox/lower-constraints/lib/python3.8/site-packages/testresources/__init__.py",
> line 786, in setUpResources
>      setattr(test, resource[0], resource[1].getResource(result))
> 
>        File "/home/zuul/src/opendev.org/openstack/zaqar/.tox/lower-constraints/lib/python3.8/site-packages/testresources/__init__.py",
> line 522, in getResource
>      self._setResource(self._make_all(result))
> 
>        File "/home/zuul/src/opendev.org/openstack/zaqar/.tox/lower-constraints/lib/python3.8/site-packages/testresources/__init__.py",
> line 551, in _make_all
>      dependency_resources[name] = resource.getResource()
> 
>        File "/home/zuul/src/opendev.org/openstack/zaqar/.tox/lower-constraints/lib/python3.8/site-packages/testresources/__init__.py",
> line 522, in getResource
>      self._setResource(self._make_all(result))
> 
>        File "/home/zuul/src/opendev.org/openstack/zaqar/.tox/lower-constraints/lib/python3.8/site-packages/testresources/__init__.py",
> line 552, in _make_all
>      resource = self.make(dependency_resources)
> 
>        File "/home/zuul/src/opendev.org/openstack/zaqar/.tox/lower-constraints/lib/python3.8/site-packages/oslo_db/sqlalchemy/provision.py",
> line 133, in make
>      url = backend.provisioned_database_url(db_token)
> 
>        File "/home/zuul/src/opendev.org/openstack/zaqar/.tox/lower-constraints/lib/python3.8/site-packages/oslo_db/sqlalchemy/provision.py",
> line 337, in provisioned_database_url
>      return self.impl.provisioned_database_url(self.url, ident)
> 
>        File "/home/zuul/src/opendev.org/openstack/zaqar/.tox/lower-constraints/lib/python3.8/site-packages/oslo_db/sqlalchemy/provision.py",
> line 498, in provisioned_database_url
>      url.database = ident
> 
>      AttributeError: can't set attribute

Recent versions of sqlalchemy made the url immutable. There's a patch[0] 
open against oslo.db to make it compatible, but it hasn't merged yet.

My guess would be that the reason you're hitting this in 
lower-constraints is that sqlalchemy isn't being correctly constrained 
and you're getting a newer one than is actually supported. That's just a 
guess though.

0: https://review.opendev.org/c/openstack/oslo.db/+/747762

> 
> 
> There is the test log:
> https://zuul.opendev.org/t/openstack/build/57eb103379b144abaa2517d41ef67610/log/job-output.txt
> 



More information about the openstack-discuss mailing list