yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #63346
[Bug 1683369] Re: TagDbObjectTestCase.test_objects_exist_validate_filters_false may fail because of non-unique id for standardattributes
Reviewed: https://review.openstack.org/457422
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=25ce9c1c88ff4dd15a688a829679f8e1854b74bc
Submitter: Jenkins
Branch: master
commit 25ce9c1c88ff4dd15a688a829679f8e1854b74bc
Author: Ihar Hrachyshka <ihrachys@xxxxxxxxxx>
Date: Mon Apr 17 18:38:42 2017 -0700
tests: allow database layer to generate id for standard attributes
Otherwise we risk a clash between multiple standard attribute records
created during a test run.
Change-Id: I965c6f9117a82aa8da20118c7b36a6dec32ac44b
Closes-Bug: #1683369
** Changed in: neutron
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1683369
Title:
TagDbObjectTestCase.test_objects_exist_validate_filters_false may fail
because of non-unique id for standardattributes
Status in neutron:
Fix Released
Bug description:
http://logs.openstack.org/00/425800/5/gate/gate-neutron-
python35/325d0d1/testr_results.html.gz
Traceback (most recent call last):
File "/home/jenkins/workspace/gate-neutron-python35/neutron/tests/unit/objects/test_tag.py", line 33, in setUp
lambda: self._create_test_standard_attribute_id()
File "/home/jenkins/workspace/gate-neutron-python35/neutron/tests/unit/objects/test_base.py", line 576, in update_obj_fields
val = v() if callable(v) else v
File "/home/jenkins/workspace/gate-neutron-python35/neutron/tests/unit/objects/test_tag.py", line 33, in <lambda>
lambda: self._create_test_standard_attribute_id()
File "/home/jenkins/workspace/gate-neutron-python35/neutron/tests/unit/objects/test_base.py", line 1381, in _create_test_standard_attribute_id
self.context, standard_attr.StandardAttribute, attrs)['id']
File "/home/jenkins/workspace/gate-neutron-python35/neutron/objects/db/api.py", line 61, in create_object
context.session.add(db_obj)
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 567, in __exit__
self.rollback()
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 187, in reraise
raise value
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 564, in __exit__
self.commit()
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 461, in commit
self._prepare_impl()
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 430, in _prepare_impl
self.session.dispatch.before_commit(self.session)
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/event/attr.py", line 218, in __call__
fn(*args, **kw)
File "/home/jenkins/workspace/gate-neutron-python35/neutron/db/api.py", line 283, in load_one_to_manys
session.flush()
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 2139, in flush
self._flush(objects)
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 2259, in _flush
transaction.rollback(_capture_exception=True)
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 187, in reraise
raise value
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 2223, in _flush
flush_context.execute()
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/unitofwork.py", line 389, in execute
rec.execute(self)
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/unitofwork.py", line 548, in execute
uow
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/persistence.py", line 181, in save_obj
mapper, table, insert)
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/orm/persistence.py", line 799, in _emit_insert_statements
execute(statement, multiparams)
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 945, in execute
return meth(self, multiparams, params)
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
compiled_sql, distilled_params
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
context)
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1398, in _handle_dbapi_exception
util.raise_from_cause(newraise, exc_info)
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 186, in reraise
raise value.with_traceback(tb)
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
context)
File "/home/jenkins/workspace/gate-neutron-python35/.tox/py35/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
cursor.execute(statement, parameters)
oslo_db.exception.DBDuplicateEntry: (sqlite3.IntegrityError) UNIQUE constraint failed: standardattributes.id [SQL: 'INSERT INTO standardattributes (id, resource_type, description, revision_number, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?)'] [parameters: (801, '232a', None, 1, '2017-04-16 00:06:13.000000', None)]
That's because _create_test_standard_attribute_id doesn't track
uniqueness for ids used.
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1683369/+subscriptions
References