From 52f6162385f53dc76cd93936114c87664f6393b6 Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Fri, 5 Feb 2016 18:53:34 -0500 Subject: [PATCH] Reduce memory consumption of gate tests Recently, the gate jobs took too long to complete (between 2 to 8 hours). The reason is jenkins slave agent die during the test, which cause the CI to re-start the whole test in a new VM. The failure mainly occurred at magnum-api pipeline, but also occurred at other pipelines. In term of distribution of test nodes, this failure mainly occurred at OVH nodes, in which there is no dedicated swap device. As a result, at OVH nodes, local disk is used for swap when memory is over-consuming. It looks this leads to resource starvation, which cause the failure. This patch attempted to reduce the memory consumption of the gate tests. In the api test, the number of worker nodes was reduced from 2 to 1. In all tests (api/k8s/swarm/mesos), the memory of worker node was reduced from 1G to 512M. Closes-Bug: #1542386 Change-Id: If7822d07f95ebc935a8763b92f038f10cf07b5ca --- magnum/tests/functional/common/config.py | 7 +++++++ magnum/tests/functional/common/datagen.py | 5 +++-- magnum/tests/functional/tempest_tests/config.py | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/magnum/tests/functional/common/config.py b/magnum/tests/functional/common/config.py index 6d92d9d..e5d9fd9 100644 --- a/magnum/tests/functional/common/config.py +++ b/magnum/tests/functional/common/config.py @@ -91,6 +91,12 @@ class Config(object): def set_magnum_url(cls, config): cls.magnum_url = CONF.magnum.get('magnum_url', None) + @classmethod + def set_master_flavor_id(cls, config): + if 'master_flavor_id' not in CONF.magnum: + raise Exception('config missing master_flavor_id key') + cls.master_flavor_id = CONF.magnum.master_flavor_id + @classmethod def setUp(cls): cls.set_admin_creds(config) @@ -105,3 +111,4 @@ class Config(object): cls.set_keypair_id(config) cls.set_flavor_id(config) cls.set_magnum_url(config) + cls.set_master_flavor_id(config) diff --git a/magnum/tests/functional/common/datagen.py b/magnum/tests/functional/common/datagen.py index f5a1225..05f53c1 100644 --- a/magnum/tests/functional/common/datagen.py +++ b/magnum/tests/functional/common/datagen.py @@ -181,7 +181,8 @@ def valid_swarm_baymodel(): return baymodel_data(image_id=config.Config.image_id, fixed_network="192.168.0.0/24", flavor_id=config.Config.flavor_id, public=False, - dns_nameserver="8.8.8.8", master_flavor_id=None, + dns_nameserver="8.8.8.8", + master_flavor_id=config.Config.master_flavor_id, keypair_id=config.Config.keypair_id, coe="swarm", docker_volume_size=3, cluster_distro=None, ssh_authorized_key=None, external_network_id="public", @@ -223,7 +224,7 @@ def bay_data(name=data_utils.rand_name('bay'), return model -def valid_bay_data(baymodel_id, name=data_utils.rand_name('bay'), node_count=2, +def valid_bay_data(baymodel_id, name=data_utils.rand_name('bay'), node_count=1, master_count=1, bay_create_timeout=None): """Generates random bay data with valid diff --git a/magnum/tests/functional/tempest_tests/config.py b/magnum/tests/functional/tempest_tests/config.py index a01f789..ecc012c 100644 --- a/magnum/tests/functional/tempest_tests/config.py +++ b/magnum/tests/functional/tempest_tests/config.py @@ -41,10 +41,14 @@ MagnumGroup = [ help="Keypair id to use to log into nova instances."), cfg.StrOpt("flavor_id", - default="m1.magnum", + default="m1.magnum2", help="Flavor id to use for baymodels."), cfg.StrOpt("magnum_url", default=None, help="Bypass URL for Magnum to skip service catalog lookup"), + + cfg.StrOpt("master_flavor_id", + default="m1.magnum", + help="Master flavor id to use for baymodels."), ]