From 8c268a6cc00d8b08e2a04a31e8ad4c79ebdc8c17 Mon Sep 17 00:00:00 2001 From: Renat Akhmerov Date: Thu, 18 Sep 2014 10:47:21 -0700 Subject: [PATCH] Fixing db properties for testing purposes Change-Id: I50c7a39b49ceac81bd5f868137b382ce1bed76d3 --- contrib/devstack/lib/mistral | 2 ++ mistral/tests/base.py | 20 ++++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/contrib/devstack/lib/mistral b/contrib/devstack/lib/mistral index cde8a9b53..c3f561da8 100644 --- a/contrib/devstack/lib/mistral +++ b/contrib/devstack/lib/mistral @@ -126,6 +126,8 @@ function configure_mistral { # Configure the database. iniset $MISTRAL_CONF_FILE database connection `database_connection_url mistral` + iniset $MISTRAL_CONF_FILE database max_overflow -1 + iniset $MISTRAL_CONF_FILE database max_pool_size 1000 # Configure keystone auth url iniset $MISTRAL_CONF_FILE keystone_authtoken auth_uri "http://${KEYSTONE_AUTH_HOST}:5000/v3" diff --git a/mistral/tests/base.py b/mistral/tests/base.py index 81ef69f11..90f41ce41 100644 --- a/mistral/tests/base.py +++ b/mistral/tests/base.py @@ -189,8 +189,12 @@ class DbTestCase(BaseTest): and can be extended by child classes. """ cfg.CONF.set_default('connection', 'sqlite://', group='database') + cfg.CONF.set_default('max_overflow', -1, group='database') + cfg.CONF.set_default('max_pool_size', 1000, group='database') + db_api_v1.setup_db() db_api_v2.setup_db() + action_manager.sync_db() def _clean_db(self): @@ -210,15 +214,15 @@ class DbTestCase(BaseTest): super(DbTestCase, self).setUp() self.__heavy_init() - cfg.CONF.set_default('connection', 'sqlite://', group='database') - db_api_v1.setup_db() - db_api_v2.setup_db() - self.ctx = auth_context.MistralContext(user_id='1-2-3-4', - project_id='5-6-7-8', - user_name='test-user', - project_name='test-project', - is_admin=False) + self.ctx = auth_context.MistralContext( + user_id='1-2-3-4', + project_id='5-6-7-8', + user_name='test-user', + project_name='test-project', + is_admin=False + ) + auth_context.set_ctx(self.ctx) self.addCleanup(auth_context.set_ctx, None)