OpenStack Common DB Code
Go to file
Roman Podoliaka 314496a581 Prevent races in opportunistic db test cases
Opportunistic db test cases create schemas on demand, so that each
test case which inherits the base test case class, will get its own
db schema (i. e. races between tests are not possible).

In order to do schema provisioning we have to connect to RDBMS server
first. So far we've been connecting to the openstack_citest database,
which is guaranteed to exist on CI nodes. It turns out, there are a
few test cases in Nova (maybe in other projects as well), that drop
and recreate the openstack_citest database. If they happen to do that
when the opportunistic db fixture is in the middle of provisioning a
schema, those tests will fail (as there is an an open session to the
database and thus it can't be dropped).

This can be solved easily by changing the way we provision new
schemas in opportunistic db test cases as actually, we don't have to
connect to the openstack_citest database at all:

 - for MySQL we can use an empty db name to connect to MySQL server,
   but not to a particular database
 - PostgreSQL requires us to specify the database name. We can use
   the service postgres database here (PostgreSQL shell utils such
   as createdb, createuser, etc use it for the very same reason)

Closes-Bug: #1328997

Change-Id: I0dc0becc5cb40d3dab3289c865a96113522a0b9a
2014-06-13 15:04:45 +03:00
doc/source Merge "Added `docs` environment to tox.ini" 2014-06-10 16:35:15 +00:00
oslo Prevent races in opportunistic db test cases 2014-06-13 15:04:45 +03:00
oslo.db/locale Setup for translation 2014-06-05 22:17:56 +02:00
tests Merge "Handle slave database connection in EngineFacade" 2014-06-11 01:05:33 +00:00
.coveragerc Fix the graduate.sh script result 2014-04-18 11:33:16 +03:00
.gitignore Ignore oslo.db.egg-info 2014-05-19 17:08:24 -05:00
.gitreview Fix .gitreview for oslo.db 2014-04-30 16:55:51 +02:00
.mailmap Fix the graduate.sh script result 2014-04-18 11:33:16 +03:00
.testr.conf Make the tests passing 2014-04-18 12:51:26 +03:00
babel.cfg Fix the graduate.sh script result 2014-04-18 11:33:16 +03:00
CONTRIBUTING.rst Added `docs` environment to tox.ini 2014-06-06 12:47:17 +03:00
HACKING.rst Fix the graduate.sh script result 2014-04-18 11:33:16 +03:00
LICENSE Fix the graduate.sh script result 2014-04-18 11:33:16 +03:00
MANIFEST.in Fix the graduate.sh script result 2014-04-18 11:33:16 +03:00
openstack-common.conf Remove common context from oslo.db 2014-06-04 17:53:26 +03:00
README.rst Added `docs` environment to tox.ini 2014-06-06 12:47:17 +03:00
requirements.txt Updated from global requirements 2014-05-29 13:46:40 +00:00
setup.cfg Merge "Added `docs` environment to tox.ini" 2014-06-10 16:35:15 +00:00
setup.py Updated from global requirements 2014-05-29 13:46:40 +00:00
test-requirements.txt Updated from global requirements 2014-05-29 13:46:40 +00:00
tox.ini Added `docs` environment to tox.ini 2014-06-06 12:47:17 +03:00

Overview

oslo.db library