← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1802209] Re: fix the tricircle unit test error

 

Fixed by the tricircle itself:
https://review.openstack.org/#/c/616104/

** Changed in: neutron
       Status: Confirmed => 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/1802209

Title:
  fix the tricircle unit test error

Status in neutron:
  Invalid

Bug description:
  
  tricircle need pass the context for get_subnet.such as 

  
  @patch.object(context, 'get_context_from_neutron_context') 
      def test_subnet_clean(self, mock_context): 
           self._basic_pod_route_setup() 
           fake_plugin = FakePlugin() 
           q_ctx = FakeNeutronContext() 
           t_ctx = context.get_db_context() 
           

  if use the admin context will result in errors.see below:
  http://logs.openstack.org/04/616104/1/check/openstack-tox-py27/83a5f70/testr_results.html.gz 

          
  ft1.20: unit.network.test_central_plugin.PluginTest.test_subnet_cleantesttools.testresult.real._StringException: Traceback (most recent call last):
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
      context)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
      cursor.execute(statement, parameters)
  sqlite3.OperationalError: no such table: subnets

  The above exception was the direct cause of the following exception:

  Traceback (most recent call last):
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/mock/mock.py", line 1305, in patched
      return func(*args, **keywargs)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/tricircle/tests/unit/network/test_central_plugin.py", line 1830, in test_subnet_clean
      q_ctx, t_router_id, {'port_id': t_port_id})
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/tricircle/network/central_plugin.py", line 2004, in remove_router_interface
      context, router_id, interface_info)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/neutron_lib/db/api.py", line 233, in wrapped
      return method(*args, **kwargs)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/src/neutron/neutron/db/l3_db.py", line 1069, in remove_router_interface
      device_owner)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/src/neutron/neutron/db/l3_db.py", line 1019, in _remove_interface_by_port
      context, router_id, port_subnet_id)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/src/neutron/neutron/db/l3_db.py", line 991, in _confirm_router_interface_not_in_use
      self._check_router_interface_not_in_use(router_id, subnet_id)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/src/neutron/neutron/db/l3_db.py", line 956, in _check_router_interface_not_in_use
      subnet = self._core_plugin.get_subnet(context, subnet_id)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/neutron_lib/db/api.py", line 233, in wrapped
      return method(*args, **kwargs)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/neutron_lib/db/api.py", line 139, in wrapped
      if is_retriable(e):
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/oslo_utils/excutils.py", line 220, in __exit__
      self.force_reraise()
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
      six.reraise(self.type_, self.value, self.tb)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/six.py", line 693, in reraise
      raise value
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/neutron_lib/db/api.py", line 136, in wrapped
      return f(*args, **kwargs)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/oslo_db/api.py", line 147, in wrapper
      ectxt.reraise = not expected
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/oslo_utils/excutils.py", line 220, in __exit__
      self.force_reraise()
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
      six.reraise(self.type_, self.value, self.tb)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/six.py", line 693, in reraise
      raise value
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/oslo_db/api.py", line 142, in wrapper
      return f(*args, **kwargs)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/neutron_lib/db/api.py", line 182, in wrapped
      if is_retriable(e):
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/oslo_utils/excutils.py", line 220, in __exit__
      self.force_reraise()
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
      six.reraise(self.type_, self.value, self.tb)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/six.py", line 693, in reraise
      raise value
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/neutron_lib/db/api.py", line 179, in wrapped
      return f(*dup_args, **dup_kwargs)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/src/neutron/neutron/db/db_base_plugin_v2.py", line 1060, in get_subnet
      subnet_obj = self._get_subnet_object(context, id)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/src/neutron/neutron/db/db_base_plugin_common.py", line 238, in _get_subnet_object
      subnet = subnet_obj.Subnet.get_object(context, id=id)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/src/neutron/neutron/objects/base.py", line 560, in get_object
      cls, context, **cls.modify_fields_to_db(kwargs))
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/src/neutron/neutron/objects/db/api.py", line 33, in get_object
      return _get_filter_query(obj_cls, context, **kwargs).first()
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 2895, in first
      ret = list(self[0:1])
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 2687, in __getitem__
      return list(res)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 2995, in __iter__
      return self._execute_and_instances(context)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 3018, in _execute_and_instances
      result = conn.execute(querycontext.statement, self._params)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 948, in execute
      return meth(self, multiparams, params)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/sqlalchemy/sql/elements.py", line 269, in _execute_on_connection
      return connection._execute_clauseelement(self, multiparams, params)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1060, in _execute_clauseelement
      compiled_sql, distilled_params
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
      context)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1409, in _handle_dbapi_exception
      util.raise_from_cause(newraise, exc_info)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 265, in raise_from_cause
      reraise(type(exception), exception, tb=exc_tb, cause=cause)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 248, in reraise
      raise value.with_traceback(tb)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
      context)
    File "/home/zuul/src/git.openstack.org/openstack/tricircle/.tox/cover/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
      cursor.execute(statement, parameters)
  oslo_db.exception.DBNonExistentTable: (sqlite3.OperationalError) no such table: subnets [SQL: 'SELECT subnets.project_id AS subnets_project_id, subnets.id AS subnets_id, subnets.name AS subnets_name, subnets.network_id AS subnets_network_id, subnets.segment_id AS subnets_segment_id, subnets.subnetpool_id AS subnets_subnetpool_id, subnets.ip_version AS subnets_ip_version, subnets.cidr AS subnets_cidr, subnets.gateway_ip AS subnets_gateway_ip, subnets.enable_dhcp AS subnets_enable_dhcp, subnets.ipv6_ra_mode AS subnets_ipv6_ra_mode, subnets.ipv6_address_mode AS subnets_ipv6_address_mode, subnets.standard_attr_id AS subnets_standard_attr_id, standardattributes_1.id AS standardattributes_1_id, standardattributes_1.resource_type AS standardattributes_1_resource_type, standardattributes_1.description AS standardattributes_1_description, standardattributes_1.revision_number AS standardattributes_1_revision_number, standardattributes_1.created_at AS standardattributes_1_created_at, standardattributes_1.updated_at AS standardattributes_1_updated_at, subnetpools_1.project_id AS subnetpools_1_project_id, subnetpools_1.id AS subnetpools_1_id, subnetpools_1.name AS subnetpools_1_name, subnetpools_1.ip_version AS subnetpools_1_ip_version, subnetpools_1.default_prefixlen AS subnetpools_1_default_prefixlen, subnetpools_1.min_prefixlen AS subnetpools_1_min_prefixlen, subnetpools_1.max_prefixlen AS subnetpools_1_max_prefixlen, subnetpools_1.shared AS subnetpools_1_shared, subnetpools_1.is_default AS subnetpools_1_is_default, subnetpools_1.default_quota AS subnetpools_1_default_quota, subnetpools_1.hash AS subnetpools_1_hash, subnetpools_1.address_scope_id AS subnetpools_1_address_scope_id, subnetpools_1.standard_attr_id AS subnetpools_1_standard_attr_id, standardattributes_2.id AS standardattributes_2_id, standardattributes_2.resource_type AS standardattributes_2_resource_type, standardattributes_2.description AS standardattributes_2_description, standardattributes_2.revision_number AS standardattributes_2_revision_number, standardattributes_2.created_at AS standardattributes_2_created_at, standardattributes_2.updated_at AS standardattributes_2_updated_at \nFROM subnets LEFT OUTER JOIN subnetpools AS subnetpools_1 ON subnets.subnetpool_id = subnetpools_1.id LEFT OUTER JOIN standardattributes AS standardattributes_1 ON standardattributes_1.id = subnetpools_1.standard_attr_id LEFT OUTER JOIN standardattributes AS standardattributes_2 ON standardattributes_2.id = subnets.standard_attr_id \nWHERE subnets.id IN (?)\n LIMIT ? OFFSET ?'] [parameters: ('82938190-a38e-46a9-aad1-df4378efc806', 1, 0)] (Background on this error at: http://sqlalche.me/e/e3q8)

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


References