oslo_db.tests.sqlalchemy.test_exc_filters.TestReferenceErrorMySQL unit tests are racy

Bug #1533861 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.db
Fix Released
High
Davanum Srinivas (DIMS)

Bug Description

Seen here:

http://logs.openstack.org/50/265950/4/check/gate-oslo.db-python27/c7011a6/testr_results.html.gz

ft20.1: oslo_db.tests.sqlalchemy.test_exc_filters.TestReferenceErrorMySQL.test_raise_delete_StringException: Empty attachments:
  stderr
  stdout

Traceback (most recent call last):
  File "oslo_db/tests/sqlalchemy/test_exc_filters.py", line 438, in test_raise_delete
    (),
  File "oslo_db/tests/sqlalchemy/test_exc_filters.py", line 40, in assertInnerException
    self.assertSQLAException(exc, exception_type, message, sql, params)
  File "oslo_db/tests/sqlalchemy/test_exc_filters.py", line 62, in assertSQLAException
    self.assertEqual(exc.params, params)
  File "/home/jenkins/workspace/gate-oslo.db-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 350, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/home/jenkins/workspace/gate-oslo.db-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 435, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: {} != ()

ft20.2: oslo_db.tests.sqlalchemy.test_exc_filters.TestReferenceErrorMySQL.test_raise_StringException: Empty attachments:
  stderr
  stdout

Traceback (most recent call last):
  File "oslo_db/tests/sqlalchemy/test_exc_filters.py", line 379, in test_raise
    (1, 2)
  File "oslo_db/tests/sqlalchemy/test_exc_filters.py", line 40, in assertInnerException
    self.assertSQLAException(exc, exception_type, message, sql, params)
  File "oslo_db/tests/sqlalchemy/test_exc_filters.py", line 60, in assertSQLAException
    self.assertEqual(exc.statement, sql)
  File "/home/jenkins/workspace/gate-oslo.db-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 350, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/home/jenkins/workspace/gate-oslo.db-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 435, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: !=:
reference = u'INSERT INTO resource_entity (id, foo_id) VALUES (%(id)s, %(foo_id)s)'
actual = 'INSERT INTO resource_entity (id, foo_id) VALUES (%s, %s)'

ft20.3: oslo_db.tests.sqlalchemy.test_exc_filters.TestReferenceErrorMySQL.test_raise_ansi_quotes_StringException: Empty attachments:
  stderr
  stdout

Traceback (most recent call last):
  File "oslo_db/tests/sqlalchemy/test_exc_filters.py", line 410, in test_raise_ansi_quotes
    (1, 2)
  File "oslo_db/tests/sqlalchemy/test_exc_filters.py", line 40, in assertInnerException
    self.assertSQLAException(exc, exception_type, message, sql, params)
  File "oslo_db/tests/sqlalchemy/test_exc_filters.py", line 60, in assertSQLAException
    self.assertEqual(exc.statement, sql)
  File "/home/jenkins/workspace/gate-oslo.db-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 350, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/home/jenkins/workspace/gate-oslo.db-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 435, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: !=:
reference = u'INSERT INTO resource_entity (id, foo_id) VALUES (%(id)s, %(foo_id)s)'
actual = 'INSERT INTO resource_entity (id, foo_id) VALUES (%s, %s)'

Logstash shows it's more than just the change being tested (which isn't hitting this code):

http://logstash.openstack.org/#/dashboard/file/logstash.json?query=message:%5C%22actual%20%20%20%20%3D%20'INSERT%20INTO%20resource_entity%20(id,%20foo_id)%20VALUES%20(%25s,%20%25s)'%5C%22%20AND%20tags:%5C%22console%5C%22%20AND%20project:%5C%22openstack%2Foslo.db%5C%22&from=7d

38 hits in 7 days, check queue only but multiple changes.

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

Note that PyMySQL==0.7.0 is being used and that was released on 1/10, so maybe there is some new wrinkle there.

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :
Changed in oslo.db:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Davanum Srinivas (DIMS) (dims-v)
Changed in oslo.db:
status: In Progress → Fix Committed
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/oslo.db 4.3.1

This issue was fixed in the openstack/oslo.db 4.3.1 release.

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/oslo.db 1.7.4

This issue was fixed in the openstack/oslo.db 1.7.4 release.

Changed in oslo.db:
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.