Newer version of SQLite (>=3.7.16) cause some of our tests to fail

Bug #1272500 reported by Lucas Alvares Gomes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Medium
Lucas Alvares Gomes
OpenStack Compute (nova)
Fix Released
Low
Unassigned

Bug Description

After upgrading my machine to fedora 20 I noticed that some of our tests were failing. Then with a bit more investigation I saw that it was related to the version of the sqlite.

The problem seems to be already fixed in oslo by the review https://review.openstack.org/#/c/61405 . We need to sync the new version of the db.sqlalchemy module from oslo to ironic in order to get it fixed in Ironic as well.

LOG:

(venv)[lucasagomes@lucasagomes ironic]$ rpm -q sqlite
sqlite-3.8.2-1.fc20.x86_64

Example of broken test:

FAIL: ironic.tests.conductor.test_manager.ManagerTestCase.test_start_registers_driver_names
tags: worker-5
----------------------------------------------------------------------
Empty attachments:
  pythonlogging:''
  stdout

stderr: {{{
ironic/openstack/common/db/sqlalchemy/session.py:486: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  m = _DUP_KEY_RE_DB[engine_name].match(integrity_error.message)
}}}

Traceback (most recent call last):
  File "ironic/tests/conductor/test_manager.py", line 73, in test_start_registers_driver_names
    self.service.start()
  File "ironic/conductor/manager.py", line 106, in start
    'drivers': self.drivers})
  File "ironic/objects/__init__.py", line 28, in wrapper
    result = fn(*args, **kwargs)
  File "ironic/db/sqlalchemy/api.py", line 521, in register_conductor
    conductor.save()
  File "ironic/openstack/common/db/sqlalchemy/models.py", line 53, in save
    session.flush()
  File "ironic/openstack/common/db/sqlalchemy/session.py", line 551, in _wrap
    raise exception.DBError(e)
DBError: (IntegrityError) UNIQUE constraint failed: conductors.hostname u'INSERT INTO conductors (created_at, updated_at, hostname, drivers) VALUES (?, ?, ?, ?)' ('2014-01-24 19:43:43.362929', '2014-01-24 19:43:43.362563', 'test-host', '["fake3", "fake4"]')

Changed in ironic:
importance: Undecided → Medium
assignee: nobody → Lucas Alvares Gomes (lucasagomes)
milestone: none → icehouse-3
summary: - New version of SQLite cause our tests to fail
+ Newer version of SQLite (>=3.7.16) cause some of our tests to fail
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

Fix proposed to branch: master
Review: https://review.openstack.org/69004

Changed in ironic:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to ironic (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/69358

Changed in ironic:
assignee: Lucas Alvares Gomes (lucasagomes) → Devananda van der Veen (devananda)
Changed in ironic:
assignee: Devananda van der Veen (devananda) → Lucas Alvares Gomes (lucasagomes)
Joe Gordon (jogo)
Changed in nova:
status: New → Confirmed
assignee: nobody → Joe Gordon (jogo)
importance: Undecided → Low
milestone: none → icehouse-3
assignee: Joe Gordon (jogo) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/71191
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=9271e300a55f8aa16ff867fff71adadb383849b8
Submitter: Jenkins
Branch: master

commit 9271e300a55f8aa16ff867fff71adadb383849b8
Author: Joe Gordon <email address hidden>
Date: Tue Feb 4 21:59:50 2014 -0800

    Sync latest db.sqlalchemy from oslo-incubator

    The solution to bug 1272500 (Unit tests failing with sqllite 3.8.2-1)
    is to use a newer version of db.sqlalchemy from oslo-incubator.
    This sync introduces a few incompatible changes that also had to
    be fixed for the unit tests to pass:

    -_extra_keys in Models must be a property
    -Additional utcnow calls were added, which broke some unit tests
    that were incorrectly mocking timeutils.utcnow. timeutils
    provides an override method that allows fake times to be returned
    in unit tests.

    Change-Id: I99685c8a1086fa4e1354f1fa0a715d88d0468dc6
    Closes-Bug: #1272500
    Co-Authored-By: Ben Nemec <email address hidden>

Changed in nova:
status: Confirmed → Fix Committed
Changed in ironic:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ironic:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-3 → 2014.1
Thierry Carrez (ttx)
Changed in ironic:
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.