Increase timeout for migration-related tests

Closes-Bug: #1626612
Change-Id: I5836733d916cd04990efa7cf402cca4cfd8b7e24
This commit is contained in:
Vladyslav Drok 2016-09-22 18:15:03 +03:00
parent e041e238be
commit 8813fc54cd

View File

@ -36,6 +36,7 @@ For postgres on Ubuntu this can be done with the following commands:
import collections
import contextlib
import fixtures
from alembic import script
import mock
@ -56,6 +57,10 @@ from ironic.tests import base
LOG = logging.getLogger(__name__)
# NOTE(vdrok): This was introduced after migration tests started taking more
# time in gate
MIGRATIONS_TIMEOUT = 300
def _get_connect_string(backend, user, passwd, database):
"""Get database connection
@ -212,6 +217,8 @@ class MigrationCheckersMixin(object):
super(MigrationCheckersMixin, self).setUp()
self.config = migration._alembic_config()
self.migration_api = migration
self.useFixture(fixtures.Timeout(MIGRATIONS_TIMEOUT,
gentle=True))
def test_walk_versions(self):
self._walk_versions(self.engine, self.config)
@ -569,6 +576,11 @@ class TestMigrationsPostgreSQL(MigrationCheckersMixin,
class ModelsMigrationSyncMixin(object):
def setUp(self):
super(ModelsMigrationSyncMixin, self).setUp()
self.useFixture(fixtures.Timeout(MIGRATIONS_TIMEOUT,
gentle=True))
def get_metadata(self):
return models.Base.metadata