test_show_policy_failed fails (depending on another test to create db?)

Bug #1495755 reported by Jesse J. Cook
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Unassigned

Bug Description

Test fails sporadically or consistency depending on your setup. I could make pass or fail consistently depending on level at which test was executed. I expect test is depending on something done outside the test that can occur out of order (i.e. db setup / table creation):

(dev)[~/src/rackspace/openstack/nova] ./run_tests.sh -d nova.tests.unit.api.openstack.compute.test_quota_classes.QuotaClassesPolicyEnforcementV21.test_show_policy_failed
Tests running...
nova/db/sqlalchemy/api.py:156: OsloDBDeprecationWarning: EngineFacade is deprecated; please use oslo.db.sqlalchemy.enginefacade
  retry_interval=conf_group.retry_interval)
======================================================================
ERROR: nova.tests.unit.api.openstack.compute.test_quota_classes.QuotaClassesPolicyEnforcementV21.test_show_policy_failed
----------------------------------------------------------------------
Empty attachments:
  pythonlogging:''

Traceback (most recent call last):
  File "nova/tests/unit/api/openstack/compute/test_quota_classes.py", line 170, in setUp
    extension_info=ext_info)
  File "nova/api/openstack/compute/quota_classes.py", line 45, in __init__
    self.supported_quotas = QUOTAS.resources
  File "nova/quota.py", line 1473, in resources
    self._register_resources_by_flavor(ctxt)
  File "nova/quota.py", line 1183, in _register_resources_by_flavor
    flavors = db.flavor_get_all(ctxt, inactive=True)
  File "nova/db/api.py", line 1455, in flavor_get_all
    sort_dir=sort_dir, limit=limit, marker=marker)
  File "nova/db/sqlalchemy/api.py", line 230, in wrapper
    return f(*args, **kwargs)
  File "nova/db/sqlalchemy/api.py", line 4835, in flavor_get_all
    inst_types = query.all()
  File "/home/jesse/src/rackspace/openstack/nova/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2399, in all
    return list(self)
  File "/home/jesse/src/rackspace/openstack/nova/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2516, in __iter__
    return self._execute_and_instances(context)
  File "/home/jesse/src/rackspace/openstack/nova/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2531, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/home/jesse/src/rackspace/openstack/nova/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
    return meth(self, multiparams, params)
  File "/home/jesse/src/rackspace/openstack/nova/.venv/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/home/jesse/src/rackspace/openstack/nova/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/home/jesse/src/rackspace/openstack/nova/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
    context)
  File "/home/jesse/src/rackspace/openstack/nova/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1337, in _handle_dbapi_exception
    util.raise_from_cause(newraise, exc_info)
  File "/home/jesse/src/rackspace/openstack/nova/.venv/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb)
  File "/home/jesse/src/rackspace/openstack/nova/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
    context)
  File "/home/jesse/src/rackspace/openstack/nova/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: instance_types [SQL: u'SELECT instance_types.created_at AS instance_types_created_at, instance_types.updated_at AS instance_types_updated_at, instance_types.deleted_at AS instance_types_deleted_at, instance_types.deleted AS instance_types_deleted, instance_types.id AS instance_types_id, instance_types.name AS instance_types_name, instance_types.memory_mb AS instance_types_memory_mb, instance_types.vcpus AS instance_types_vcpus, instance_types.root_gb AS instance_types_root_gb, instance_types.ephemeral_gb AS instance_types_ephemeral_gb, instance_types.flavorid AS instance_types_flavorid, instance_types.swap AS instance_types_swap, instance_types.rxtx_factor AS instance_types_rxtx_factor, instance_types.vcpu_weight AS instance_types_vcpu_weight, instance_types.disabled AS instance_types_disabled, instance_types.is_public AS instance_types_is_public, instance_type_extra_specs_1.created_at AS instance_type_extra_specs_1_created_at, instance_type_extra_specs_1.updated_at AS instance_type_extra_specs_1_updated_at, instance_type_extra_specs_1.deleted_at AS instance_type_extra_specs_1_deleted_at, instance_type_extra_specs_1.deleted AS instance_type_extra_specs_1_deleted, instance_type_extra_specs_1.id AS instance_type_extra_specs_1_id, instance_type_extra_specs_1."key" AS instance_type_extra_specs_1_key, instance_type_extra_specs_1.value AS instance_type_extra_specs_1_value, instance_type_extra_specs_1.instance_type_id AS instance_type_extra_specs_1_instance_type_id \nFROM instance_types LEFT OUTER JOIN instance_type_extra_specs AS instance_type_extra_specs_1 ON instance_type_extra_specs_1.instance_type_id = instance_types.id AND instance_type_extra_specs_1.deleted = ? ORDER BY instance_types.flavorid ASC, instance_types.id ASC'] [parameters: (0,)]

Ran 1 test in 0.784s
FAILED (failures=1)
(dev)[~/src/rackspace/openstack/nova] ./run_tests.sh -d nova.tests.unit.api.openstack.compute.test_quota_classes
Tests running...
nova/context.py:185: DeprecationWarning: Using function/method 'oslo_utils.timeutils.strtime()' is deprecated in version '1.6' and will be removed in a future version: use either datetime.datetime.isoformat() or datetime.datetime.strftime() instead
  self, 'timestamp') else None,

Ran 20 tests in 2.761s
OK
(dev)[~/src/rackspace/openstack/nova]

Tags: quotas testing
tags: added: quotas testing
Revision history for this message
Matt Riedemann (mriedem) wrote :

What level of code? Git hash? And does this fail with tox?

Revision history for this message
Matt Riedemann (mriedem) wrote :

class QuotaClassesPolicyEnforcementV21(test.NoDBTestCase): is a NoDBTestCase so it shouldn't be accessing the database at all.

I have no problem running that test on it's own:

http://paste.openstack.org/show/473910/

Remember that RAX has out of tree things for quota classes, so maybe you're just hitting failures because of forks in the RAX version of nova's quota classes.

Changed in nova:
status: New → Invalid
Revision history for this message
Jesse J. Cook (jesse-j-cook) wrote :

Well that's embarrassing. This bug does not effect openstack/master. Apologies.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.