Restore timeout_scaling_factor
In a previous refactor, we lost the part where we actually multiple TIMEOUT_SCALING_FACTOR to the timeout. Whoops. Also, turn off keepalive in the underlying session. For devstack functional tests, we're seeing a lot of "Resetting dropped connection" so I'm thinking we should just disable that. Also, increase the individual test timeout, and bump the scaling factor on trunk tests, which always seem to be timing out. Change-Id: Ie5b3eb319fed10cabfb2e818f3fcfd52b6fd7b14
This commit is contained in:
parent
d8aaeb9a9c
commit
b5c96c5e44
|
@ -41,9 +41,15 @@ class TestCase(base.BaseTestCase):
|
|||
# Do this before super setUp so that we intercept the default value
|
||||
# in oslotest. TODO(mordred) Make the default timeout configurable
|
||||
# in oslotest.
|
||||
self.useFixture(
|
||||
fixtures.EnvironmentVariable(
|
||||
'OS_TEST_TIMEOUT', os.environ.get('OS_TEST_TIMEOUT', '5')))
|
||||
test_timeout = int(os.environ.get('OS_TEST_TIMEOUT', '5'))
|
||||
try:
|
||||
test_timeout = int(test_timeout * self.TIMEOUT_SCALING_FACTOR)
|
||||
self.useFixture(
|
||||
fixtures.EnvironmentVariable(
|
||||
'OS_TEST_TIMEOUT', str(test_timeout)))
|
||||
except ValueError:
|
||||
# Let oslotest do its thing
|
||||
pass
|
||||
|
||||
super(TestCase, self).setUp()
|
||||
|
||||
|
|
|
@ -34,6 +34,10 @@ def _get_resource_value(resource_key, default):
|
|||
return default
|
||||
|
||||
|
||||
def _disable_keep_alive(conn):
|
||||
sess = conn.config.get_session()
|
||||
sess.keep_alive = False
|
||||
|
||||
IMAGE_NAME = _get_resource_value('image_name', 'cirros-0.3.5-x86_64-disk')
|
||||
FLAVOR_NAME = _get_resource_value('flavor_name', 'm1.small')
|
||||
|
||||
|
@ -43,6 +47,7 @@ class BaseFunctionalTest(base.TestCase):
|
|||
def setUp(self):
|
||||
super(BaseFunctionalTest, self).setUp()
|
||||
self.conn = connection.Connection(config=TEST_CLOUD_REGION)
|
||||
_disable_keep_alive(self.conn)
|
||||
|
||||
self._demo_name = os.environ.get('OPENSTACKSDK_DEMO_CLOUD', 'devstack')
|
||||
self._op_name = os.environ.get(
|
||||
|
@ -59,11 +64,13 @@ class BaseFunctionalTest(base.TestCase):
|
|||
user_config = self.config.get_one(
|
||||
cloud=self._demo_name, **kwargs)
|
||||
self.user_cloud = connection.Connection(config=user_config)
|
||||
_disable_keep_alive(self.user_cloud)
|
||||
|
||||
def _set_operator_cloud(self, **kwargs):
|
||||
operator_config = self.config.get_one(
|
||||
cloud=self._op_name, **kwargs)
|
||||
self.operator_cloud = connection.Connection(config=operator_config)
|
||||
_disable_keep_alive(self.operator_cloud)
|
||||
|
||||
def pick_image(self):
|
||||
images = self.user_cloud.list_images()
|
||||
|
|
|
@ -19,6 +19,8 @@ from openstack.tests.functional import base
|
|||
|
||||
class TestTrunk(base.BaseFunctionalTest):
|
||||
|
||||
TIMEOUT_SCALING_FACTOR = 2.0
|
||||
|
||||
def setUp(self):
|
||||
super(TestTrunk, self).setUp()
|
||||
self.TRUNK_NAME = self.getUniqueString()
|
||||
|
|
2
tox.ini
2
tox.ini
|
@ -31,7 +31,7 @@ commands = stestr --test-path ./openstack/tests/examples run {posargs}
|
|||
basepython = {env:OPENSTACKSDK_TOX_PYTHON:python2}
|
||||
setenv =
|
||||
{[testenv]setenv}
|
||||
OS_TEST_TIMEOUT=90
|
||||
OS_TEST_TIMEOUT=120
|
||||
commands = stestr --test-path ./openstack/tests/functional/{env:OPENSTACKSDK_TESTS_SUBDIR:} run --serial {posargs}
|
||||
stestr slowest
|
||||
|
||||
|
|
Loading…
Reference in New Issue