← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2034761] Re: test discovery fail with latest neutron-lib

 

Okay, after lots of talk in #openstack-neutron we figured it out:

- networking-baremetal was released before the library freeze, as usual
- so was neutron-lib

This means if you run tests on (master or latest release) networking-
baremetal, it pulls in:

- 2023.2 neutron-lib
- 2023.1 neutron

Which are incompatible.

This is not ideal, but there's really no way for us to work around this
without creating more problems than it's worth. I'm going to mark this
as INVALID.

** Changed in: neutron
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/2034761

Title:
  test discovery fail with latest neutron-lib

Status in neutron:
  Invalid

Bug description:
  Hi,

  Building networking-baremetal 6.2.0 together with the latest neutron-lib 3.8.0 in my bookworm-backports build server, I get a test discovery error from stestr (see Debian package build log below). Apparently, it looks like it's because of this commit:
  https://github.com/openstack/neutron-lib/commit/673e48a1890c721654ce0de9cd9e0897c791bd6a 

  that networking is still using. Here's the build log:

  PYTHON=python3.11 stestr run --parallel --subunit networking_baremetal.tests.* | subunit2pyunit
  [...]

  /usr/lib/python3/dist-packages/neutron/db/quota/models.py:21: SAWarning: This declarative base already contains a class with the same class name and module name as neutron.db.quota.models.ResourceDelta, and will be replaced in the string-lookup table.
    class ResourceDelta(model_base.BASEV2):
  /usr/lib/python3/dist-packages/neutron/db/qos/models.py:27: SAWarning: This declarative base already contains a class with the same class name and module name as neutron.db.qos.models.QosPolicy, and will be replaced in the string-lookup table.
    class QosPolicy(standard_attr.HasStandardAttributes, model_base.BASEV2,

  =========================
  Failures during discovery
  =========================
  --- import errors ---
  Failed to import test module: networking_baremetal.tests.unit.drivers.netconf.test_openconfig
  Traceback (most recent call last):
    File "/usr/lib/python3.11/unittest/loader.py", line 407, in _find_test_path
      module = self._get_module_from_name(name)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.11/unittest/loader.py", line 350, in _get_module_from_name
      __import__(name)
    File "/<<PKGBUILDDIR>>/networking_baremetal/tests/unit/drivers/netconf/test_openconfig.py", line 17, in <module>
      from neutron.plugins.ml2 import driver_context
    File "/usr/lib/python3/dist-packages/neutron/plugins/ml2/driver_context.py", line 23, in <module>
      from neutron.db import segments_db
    File "/usr/lib/python3/dist-packages/neutron/db/segments_db.py", line 23, in <module>
      from neutron.objects import network as network_obj
    File "/usr/lib/python3/dist-packages/neutron/objects/network.py", line 33, in <module>
      from neutron.objects.qos import binding
    File "/usr/lib/python3/dist-packages/neutron/objects/qos/binding.py", line 25, in <module>
      from neutron.db.qos import models as qos_db_model
    File "/usr/lib/python3/dist-packages/neutron/db/qos/models.py", line 135, in <module>
      model_base.HasProjectPrimaryKeyIndex):
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  AttributeError: module 'neutron_lib.db.model_base' has no attribute 'HasProjectPrimaryKeyIndex'

  Failed to import test module: networking_baremetal.tests.unit.ironic_agent.test_hashring_member_manager
  Traceback (most recent call last):
    File "/usr/lib/python3.11/unittest/loader.py", line 407, in _find_test_path
      module = self._get_module_from_name(name)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.11/unittest/loader.py", line 350, in _get_module_from_name
      __import__(name)
    File "/<<PKGBUILDDIR>>/networking_baremetal/tests/unit/ironic_agent/test_hashring_member_manager.py", line 21, in <module>
      from networking_baremetal.agent import ironic_neutron_agent
    File "/<<PKGBUILDDIR>>/networking_baremetal/agent/ironic_neutron_agent.py", line 23, in <module>
      from neutron.agent import rpc as agent_rpc
    File "/usr/lib/python3/dist-packages/neutron/agent/rpc.py", line 36, in <module>
      from neutron.agent import resource_cache
    File "/usr/lib/python3/dist-packages/neutron/agent/resource_cache.py", line 22, in <module>
      from neutron.api.rpc.callbacks.consumer import registry as registry_rpc
    File "/usr/lib/python3/dist-packages/neutron/api/rpc/callbacks/consumer/registry.py", line 13, in <module>
      from neutron.api.rpc.callbacks import resource_manager
    File "/usr/lib/python3/dist-packages/neutron/api/rpc/callbacks/resource_manager.py", line 20, in <module>
      from neutron.api.rpc.callbacks import resources
    File "/usr/lib/python3/dist-packages/neutron/api/rpc/callbacks/resources.py", line 14, in <module>
      from neutron.objects import address_group
    File "/usr/lib/python3/dist-packages/neutron/objects/address_group.py", line 22, in <module>
      from neutron.objects import rbac_db
    File "/usr/lib/python3/dist-packages/neutron/objects/rbac_db.py", line 28, in <module>
      from neutron.db import rbac_db_mixin
    File "/usr/lib/python3/dist-packages/neutron/db/rbac_db_mixin.py", line 25, in <module>
      from neutron.extensions import rbac as ext_rbac
    File "/usr/lib/python3/dist-packages/neutron/extensions/rbac.py", line 23, in <module>
      from neutron.api.v2 import base
    File "/usr/lib/python3/dist-packages/neutron/api/v2/base.py", line 37, in <module>
      from neutron import quota
    File "/usr/lib/python3/dist-packages/neutron/quota/__init__.py", line 21, in <module>
      from neutron.quota import resource_registry
    File "/usr/lib/python3/dist-packages/neutron/quota/resource_registry.py", line 20, in <module>
      from neutron.quota import resource
    File "/usr/lib/python3/dist-packages/neutron/quota/resource.py", line 28, in <module>
      from neutron.db.quota import api as quota_api
    File "/usr/lib/python3/dist-packages/neutron/db/quota/api.py", line 22, in <module>
      from neutron.objects import quota as quota_obj
    File "/usr/lib/python3/dist-packages/neutron/objects/quota.py", line 21, in <module>
      from neutron.db.quota import models
    File "/usr/lib/python3/dist-packages/neutron/db/quota/models.py", line 57, in <module>
      class QuotaUsage(model_base.BASEV2, model_base.HasProjectPrimaryKeyIndex):
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  AttributeError: module 'neutron_lib.db.model_base' has no attribute 'HasProjectPrimaryKeyIndex'

  Failed to import test module: networking_baremetal.tests.unit.ironic_agent.test_ironic_agent
  Traceback (most recent call last):
    File "/usr/lib/python3.11/unittest/loader.py", line 407, in _find_test_path
      module = self._get_module_from_name(name)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.11/unittest/loader.py", line 350, in _get_module_from_name
      __import__(name)
    File "/<<PKGBUILDDIR>>/networking_baremetal/tests/unit/ironic_agent/test_ironic_agent.py", line 18, in <module>
      from neutron.agent import rpc as agent_rpc
    File "/usr/lib/python3/dist-packages/neutron/agent/rpc.py", line 36, in <module>
      from neutron.agent import resource_cache
    File "/usr/lib/python3/dist-packages/neutron/agent/resource_cache.py", line 22, in <module>
      from neutron.api.rpc.callbacks.consumer import registry as registry_rpc
    File "/usr/lib/python3/dist-packages/neutron/api/rpc/callbacks/consumer/registry.py", line 13, in <module>
      from neutron.api.rpc.callbacks import resource_manager
    File "/usr/lib/python3/dist-packages/neutron/api/rpc/callbacks/resource_manager.py", line 20, in <module>
      from neutron.api.rpc.callbacks import resources
    File "/usr/lib/python3/dist-packages/neutron/api/rpc/callbacks/resources.py", line 14, in <module>
      from neutron.objects import address_group
    File "/usr/lib/python3/dist-packages/neutron/objects/address_group.py", line 22, in <module>
      from neutron.objects import rbac_db
    File "/usr/lib/python3/dist-packages/neutron/objects/rbac_db.py", line 28, in <module>
      from neutron.db import rbac_db_mixin
    File "/usr/lib/python3/dist-packages/neutron/db/rbac_db_mixin.py", line 25, in <module>
      from neutron.extensions import rbac as ext_rbac
    File "/usr/lib/python3/dist-packages/neutron/extensions/rbac.py", line 23, in <module>
      from neutron.api.v2 import base
    File "/usr/lib/python3/dist-packages/neutron/api/v2/base.py", line 37, in <module>
      from neutron import quota
    File "/usr/lib/python3/dist-packages/neutron/quota/__init__.py", line 21, in <module>
      from neutron.quota import resource_registry
    File "/usr/lib/python3/dist-packages/neutron/quota/resource_registry.py", line 20, in <module>
      from neutron.quota import resource
    File "/usr/lib/python3/dist-packages/neutron/quota/resource.py", line 28, in <module>
      from neutron.db.quota import api as quota_api
    File "/usr/lib/python3/dist-packages/neutron/db/quota/api.py", line 22, in <module>
      from neutron.objects import quota as quota_obj
    File "/usr/lib/python3/dist-packages/neutron/objects/quota.py", line 21, in <module>
      from neutron.db.quota import models
    File "/usr/lib/python3/dist-packages/neutron/db/quota/models.py", line 21, in <module>
      class ResourceDelta(model_base.BASEV2):
    File "/usr/lib/python3/dist-packages/sqlalchemy/orm/decl_api.py", line 76, in __init__
      _as_declarative(reg, cls, dict_)
    File "/usr/lib/python3/dist-packages/sqlalchemy/orm/decl_base.py", line 126, in _as_declarative
      return _MapperConfig.setup_mapping(registry, cls, dict_, None, {})
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/sqlalchemy/orm/decl_base.py", line 183, in setup_mapping
      return cfg_cls(registry, cls_, dict_, table, mapper_kw)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/sqlalchemy/orm/decl_base.py", line 331, in __init__
      self._setup_table(table)
    File "/usr/lib/python3/dist-packages/sqlalchemy/orm/decl_base.py", line 854, in _setup_table
      table_cls(
    File "<string>", line 2, in __new__
    File "/usr/lib/python3/dist-packages/sqlalchemy/util/deprecations.py", line 375, in warned
      return fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/sqlalchemy/sql/schema.py", line 596, in __new__
      raise exc.InvalidRequestError(
  sqlalchemy.exc.InvalidRequestError: Table 'resourcedeltas' is already defined for this MetaData instance.  Specify 'extend_existing=True' to redefine options and columns on an existing Table object.

  Failed to import test module: networking_baremetal.tests.unit.plugins.ml2.test_baremetal_mech
  Traceback (most recent call last):
    File "/usr/lib/python3.11/unittest/loader.py", line 407, in _find_test_path
      module = self._get_module_from_name(name)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.11/unittest/loader.py", line 350, in _get_module_from_name
      __import__(name)
    File "/<<PKGBUILDDIR>>/networking_baremetal/tests/unit/plugins/ml2/test_baremetal_mech.py", line 19, in <module>
      from neutron.plugins.ml2 import driver_context
    File "/usr/lib/python3/dist-packages/neutron/plugins/ml2/driver_context.py", line 23, in <module>
      from neutron.db import segments_db
    File "/usr/lib/python3/dist-packages/neutron/db/segments_db.py", line 23, in <module>
      from neutron.objects import network as network_obj
    File "/usr/lib/python3/dist-packages/neutron/objects/network.py", line 33, in <module>
      from neutron.objects.qos import binding
    File "/usr/lib/python3/dist-packages/neutron/objects/qos/binding.py", line 25, in <module>
      from neutron.db.qos import models as qos_db_model
    File "/usr/lib/python3/dist-packages/neutron/db/qos/models.py", line 27, in <module>
      class QosPolicy(standard_attr.HasStandardAttributes, model_base.BASEV2,
    File "/usr/lib/python3/dist-packages/sqlalchemy/orm/decl_api.py", line 76, in __init__
      _as_declarative(reg, cls, dict_)
    File "/usr/lib/python3/dist-packages/sqlalchemy/orm/decl_base.py", line 126, in _as_declarative
      return _MapperConfig.setup_mapping(registry, cls, dict_, None, {})
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/sqlalchemy/orm/decl_base.py", line 183, in setup_mapping
      return cfg_cls(registry, cls_, dict_, table, mapper_kw)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/sqlalchemy/orm/decl_base.py", line 331, in __init__
      self._setup_table(table)
    File "/usr/lib/python3/dist-packages/sqlalchemy/orm/decl_base.py", line 854, in _setup_table
      table_cls(
    File "<string>", line 2, in __new__
    File "/usr/lib/python3/dist-packages/sqlalchemy/util/deprecations.py", line 375, in warned
      return fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/sqlalchemy/sql/schema.py", line 596, in __new__
      raise exc.InvalidRequestError(
  sqlalchemy.exc.InvalidRequestError: Table 'qos_policies' is already defined for this MetaData instance.  Specify 'extend_existing=True' to redefine options and columns on an existing Table object.

  ================================================================================
  The above traceback was encountered during test discovery which imports all the found test modules in the specified test_path.

  ----------------------------------------------------------------------
  Ran 0 tests in 5.903s

  OK
  + stestr slowest
  make[1]: *** [debian/rules:29: override_dh_install] Error 3

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/2034761/+subscriptions