Keystone unit tests fails with SQLAlchemy 0.9.3

Bug #1286717 reported by Thomas Goirand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
Morgan Fainberg
Havana
Fix Released
Medium
Morgan Fainberg

Bug Description

Keystone fails its unit tests when running with SQLAlchemy 0.9.3, as per the log below. It is important for Debian that Havana Keystone continues to work in Sid with SQLA 0.9.

======================================================================
ERROR: keystone.tests.test_sql_upgrade.SqlUpgradeTests.test_upgrade_14_to_16
----------------------------------------------------------------------
_StringException: traceback-1: {{{
Traceback (most recent call last):
  File "/home/zigo/sources/openstack/havana/keystone/build-area/keystone-2013.2.2/keystone/tests/test_sql_upgrade.py", line 90, in tearDown
    self.downgrade(0)
  File "/home/zigo/sources/openstack/havana/keystone/build-area/keystone-2013.2.2/keystone/tests/test_sql_upgrade.py", line 125, in downgrade
    self._migrate(*args, downgrade=True, **kwargs)
  File "/home/zigo/sources/openstack/havana/keystone/build-area/keystone-2013.2.2/keystone/tests/test_sql_upgrade.py", line 139, in _migrate
    self.schema.runchange(ver, change, changeset.step)
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/schema.py", line 91, in runchange
    change.run(self.engine, step)
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/script/py.py", line 145, in run
    script_func(engine)
  File "/home/zigo/sources/openstack/havana/keystone/build-area/keystone-2013.2.2/keystone/common/sql/migrate_repo/versions/016_normalize_domain_ids.py", line 430, in downgrade
    downgrade_user_table_with_copy(meta, migrate_engine, session)
  File "/home/zigo/sources/openstack/havana/keystone/build-area/keystone-2013.2.2/keystone/common/sql/migrate_repo/versions/016_normalize_domain_ids.py", line 225, in downgrade_user_table_with_copy
    'extra': user.extra})
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 978, in execute
    clause, params or {})
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 717, in execute
    return meth(self, multiparams, params)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 317, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 814, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 927, in _execute_context
    context)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1076, in _handle_dbapi_exception
    exc_info
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 185, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 920, in _execute_context
    context)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 425, in do_execute
    cursor.execute(statement, parameters)
IntegrityError: (IntegrityError) UNIQUE constraint failed: temp_user.name u'insert into temp_user (id, name, password, enabled, extra) values ( ?, ?, ?, ?, ?);' (u'433e0e1c02ff436a9bf1829ee42790d1', u'6327d5d819064064a82bc10e0ef7fdca', u'5ef83255a7df4fb1a3ae1d6877719a1e', True, u'{}')
}}}

Traceback (most recent call last):
  File "/home/zigo/sources/openstack/havana/keystone/build-area/keystone-2013.2.2/keystone/tests/test_sql_upgrade.py", line 487, in test_upgrade_14_to_16
    self.check_uniqueness_constraints()
  File "/home/zigo/sources/openstack/havana/keystone/build-area/keystone-2013.2.2/keystone/tests/test_sql_upgrade.py", line 882, in check_uniqueness_constraints
    cmd = this_table.delete(id=user['id'])
  File "<string>", line 1, in <lambda>
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/selectable.py", line 1237, in delete
    return dml.Delete(self, whereclause, **kwargs)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/dml.py", line 749, in __init__
    self._validate_dialect_kwargs(dialect_kw)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/base.py", line 132, in _validate_dialect_kwargs
    "named <dialectname>_<argument>, got '%s'" % k)
TypeError: Additional arguments should be named <dialectname>_<argument>, got 'id'

Changed in keystone:
assignee: nobody → Morgan Fainberg (mdrnstm)
status: New → In Progress
Changed in keystone:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/77391
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=622606d7b4cc9639de99ddea3848c184daa80c69
Submitter: Jenkins
Branch: master

commit 622606d7b4cc9639de99ddea3848c184daa80c69
Author: Morgan Fainberg <email address hidden>
Date: Sat Mar 1 21:31:54 2014 -0800

    SQLAlchemy Change to support more strict dialect checking

    Update a couple DELETE operations within the test_sql_upgrade test
    case to support the more strict dialect checking that occurs in
    0.9.3 of SQLAlchemy for "additional arguments".

    Closes-Bug: #1286717
    Change-Id: I82b57257a8b49d798d813c65e76757021676ba90

Changed in keystone:
status: In Progress → Fix Committed
Revision history for this message
Alan Pevec (apevec) wrote :

Proposed for keystone stable/havana https://review.openstack.org/77392

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (stable/havana)

Reviewed: https://review.openstack.org/77392
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=181c3c1dcc2e6ab6cd0a6c59d3b0ef9610a6d893
Submitter: Jenkins
Branch: stable/havana

commit 181c3c1dcc2e6ab6cd0a6c59d3b0ef9610a6d893
Author: Morgan Fainberg <email address hidden>
Date: Sat Mar 1 21:31:54 2014 -0800

    SQLAlchemy Change to support more strict dialect checking

    Update a couple DELETE operations within the test_sql_upgrade test
    case to support the more strict dialect checking that occurs in
    0.9.3 of SQLAlchemy for "additional arguments".

    Closes-Bug: #1286717
    Change-Id: I82b57257a8b49d798d813c65e76757021676ba90

Thierry Carrez (ttx)
Changed in keystone:
milestone: none → icehouse-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: icehouse-3 → 2014.1
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.