oslo_db.tests.sqlalchemy.test_utils.MySQLTestMigrations.test_insert_from_select_with_specified_columns_negative fails in the gate

Bug #1442178 reported by Roman Podoliaka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.db
Fix Released
High
Roman Podoliaka

Bug Description

A couple of gate jobs failed recently with:

2015-04-08 17:23:43.605 | ==============================
2015-04-08 17:23:43.605 | Failed 1 tests - output below:
2015-04-08 17:23:43.605 | ==============================
2015-04-08 17:23:43.605 |
2015-04-08 17:23:43.605 | oslo_db.tests.sqlalchemy.test_utils.MySQLTestMigrations.test_insert_from_select_with_specified_columns_negative
2015-04-08 17:23:43.605 | ---------------------------------------------------------------------------------------------------------------
2015-04-08 17:23:43.605 |
2015-04-08 17:23:43.605 | Captured traceback:
2015-04-08 17:23:43.605 | ~~~~~~~~~~~~~~~~~~~
2015-04-08 17:23:43.606 | Traceback (most recent call last):
2015-04-08 17:23:43.606 | File "/home/jenkins/workspace/gate-oslo.db-python26/oslo_db/tests/sqlalchemy/test_utils.py", line 583, in test_insert_from_select_with_specified_columns_negative
2015-04-08 17:23:43.606 | insert_statement)
2015-04-08 17:23:43.606 | File "/home/jenkins/workspace/gate-oslo.db-python26/.tox/py26/lib/python2.6/site-packages/testtools/testcase.py", line 422, in assertRaises
2015-04-08 17:23:43.606 | self.assertThat(our_callable, matcher)
2015-04-08 17:23:43.606 | File "/home/jenkins/workspace/gate-oslo.db-python26/.tox/py26/lib/python2.6/site-packages/testtools/testcase.py", line 433, in assertThat
2015-04-08 17:23:43.606 | mismatch_error = self._matchHelper(matchee, matcher, message, verbose)
2015-04-08 17:23:43.606 | File "/home/jenkins/workspace/gate-oslo.db-python26/.tox/py26/lib/python2.6/site-packages/testtools/testcase.py", line 483, in _matchHelper
2015-04-08 17:23:43.606 | mismatch = matcher.match(matchee)
2015-04-08 17:23:43.606 | File "/home/jenkins/workspace/gate-oslo.db-python26/.tox/py26/lib/python2.6/site-packages/testtools/matchers/_exception.py", line 108, in match
2015-04-08 17:23:43.606 | mismatch = self.exception_matcher.match(exc_info)
2015-04-08 17:23:43.607 | File "/home/jenkins/workspace/gate-oslo.db-python26/.tox/py26/lib/python2.6/site-packages/testtools/matchers/_higherorder.py", line 62, in match
2015-04-08 17:23:43.607 | mismatch = matcher.match(matchee)
2015-04-08 17:23:43.607 | File "/home/jenkins/workspace/gate-oslo.db-python26/.tox/py26/lib/python2.6/site-packages/testtools/testcase.py", line 414, in match
2015-04-08 17:23:43.607 | reraise(*matchee)
2015-04-08 17:23:43.607 | File "/home/jenkins/workspace/gate-oslo.db-python26/.tox/py26/lib/python2.6/site-packages/testtools/matchers/_exception.py", line 101, in match
2015-04-08 17:23:43.607 | result = matchee()
2015-04-08 17:23:43.607 | File "/home/jenkins/workspace/gate-oslo.db-python26/.tox/py26/lib/python2.6/site-packages/testtools/testcase.py", line 969, in __call__
2015-04-08 17:23:43.607 | return self._callable_object(*self._args, **self._kwargs)
2015-04-08 17:23:43.607 | File "/home/jenkins/workspace/gate-oslo.db-python26/.tox/py26/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 841, in execute
2015-04-08 17:23:43.607 | return meth(self, multiparams, params)
2015-04-08 17:23:43.608 | File "/home/jenkins/workspace/gate-oslo.db-python26/.tox/py26/lib/python2.6/site-packages/sqlalchemy/sql/elements.py", line 322, in _execute_on_connection
2015-04-08 17:23:43.608 | return connection._execute_clauseelement(self, multiparams, params)
2015-04-08 17:23:43.608 | File "/home/jenkins/workspace/gate-oslo.db-python26/.tox/py26/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 938, in _execute_clauseelement
2015-04-08 17:23:43.608 | compiled_sql, distilled_params
2015-04-08 17:23:43.608 | File "/home/jenkins/workspace/gate-oslo.db-python26/.tox/py26/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 1070, in _execute_context
2015-04-08 17:23:43.608 | context)
2015-04-08 17:23:43.608 | File "/home/jenkins/workspace/gate-oslo.db-python26/oslo_db/sqlalchemy/compat/handle_error.py", line 261, in _handle_dbapi_exception
2015-04-08 17:23:43.608 | e, statement, parameters, cursor, context)
2015-04-08 17:23:43.608 | File "/home/jenkins/workspace/gate-oslo.db-python26/.tox/py26/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 1267, in _handle_dbapi_exception
2015-04-08 17:23:43.609 | util.raise_from_cause(newraise, exc_info)
2015-04-08 17:23:43.609 | File "/home/jenkins/workspace/gate-oslo.db-python26/.tox/py26/lib/python2.6/site-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
2015-04-08 17:23:43.609 | reraise(type(exception), exception, tb=exc_tb)
2015-04-08 17:23:43.609 | File "/home/jenkins/workspace/gate-oslo.db-python26/.tox/py26/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 1063, in _execute_context
2015-04-08 17:23:43.609 | context)
2015-04-08 17:23:43.609 | File "/home/jenkins/workspace/gate-oslo.db-python26/.tox/py26/lib/python2.6/site-packages/sqlalchemy/engine/default.py", line 442, in do_execute
2015-04-08 17:23:43.609 | cursor.execute(statement, parameters)
2015-04-08 17:23:43.609 | File "/home/jenkins/workspace/gate-oslo.db-python26/.tox/py26/lib/python2.6/site-packages/MySQLdb/cursors.py", line 205, in execute
2015-04-08 17:23:43.617 | self.errorhandler(self, exc, value)
2015-04-08 17:23:43.617 | File "/home/jenkins/workspace/gate-oslo.db-python26/.tox/py26/lib/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
2015-04-08 17:23:43.617 | raise errorclass, errorvalue
2015-04-08 17:23:43.617 | sqlalchemy.exc.OperationalError: (OperationalError) (1366, "Incorrect integer value: 'f3c13eb974d247c3a368aac911dae791' for column 'id' at row 1") 'INSERT INTO __test_insert_to_table__ (uuid, id) SELECT __test_select_from_table__.id, __test_select_from_table__.uuid \nFROM __test_select_from_table__ \nWHERE __test_select_from_table__.id < %s ORDER BY __test_select_from_table__.id' (5,)

The problem is that the negative test case inserts randomly generated UUID values into an integer column and MySQL throws two different errors, depending on whether a particular UUID starts with a decimal digit or not.

We should handle both errors and wrap them with a high level DataError exception.

Changed in oslo.db:
milestone: 1.8.0 → next-liberty
Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

This has actually been closed for a while now - https://review.openstack.org/#/c/172099/

Changed in oslo.db:
status: Triaged → Fix Committed
status: Fix Committed → Fix Released
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.