summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhao Chao <zhaochao1984@gmail.com>2018-06-27 12:10:42 +0800
committerZhao Chao <zhaochao1984@gmail.com>2018-07-09 23:14:40 +0800
commitceaaf161e3ea9c0b6bcbe8aa48beda800b867d67 (patch)
treec0acf3f7faf66e7bfffc6dd908ef63ac67115f3c
parentdc8824966c46bb2c168403d8bd3c30355d98bea1 (diff)
downloadtrove-ceaaf161e3ea9c0b6bcbe8aa48beda800b867d67.tar.gz
Raise timeout for instance resizing checking job
Recently the trove-functional-mysql usually failed by timeout at the test_instance_returns_to_active_after_resize case, and the cause is creating and resizing instances could be quit slow(e.g. 1200+ seconds). This may be caused by the pressure of the CI system and should be further investigated. The patch is a quick fix for the problem by raising the timeout to 30 minutes(it's now 900 seconds by default, but instead it's 32 minutes for instance creating, so raising the value to 30 minutes should be reasonable). Partial-Bug: #1778837 Change-Id: Ib903a72b098499553978ec881843a7bbee25b45f Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
-rw-r--r--playbooks/legacy/trove-functional-dsvm-mysql/run.yaml2
-rw-r--r--trove/tests/api/instances_actions.py14
2 files changed, 15 insertions, 1 deletions
diff --git a/playbooks/legacy/trove-functional-dsvm-mysql/run.yaml b/playbooks/legacy/trove-functional-dsvm-mysql/run.yaml
index d04890e1..17dbbcd7 100644
--- a/playbooks/legacy/trove-functional-dsvm-mysql/run.yaml
+++ b/playbooks/legacy/trove-functional-dsvm-mysql/run.yaml
@@ -30,6 +30,7 @@
cat << 'EOF' >>"/tmp/dg-local.conf"
[[local|localrc]]
enable_plugin trove git://git.openstack.org/openstack/trove
+ TROVE_RESIZE_TIME_OUT=1800
EOF
executable: /bin/bash
@@ -56,6 +57,7 @@
export DEST=$BASE/new
export PATH_DEVSTACK_SRC=$DEST/devstack
cd /opt/stack/new/trove/integration/scripts
+ export TROVE_RESIZE_TIME_OUT=1800
./trovestack dsvm-gate-tests mysql
}
export -f post_test_hook
diff --git a/trove/tests/api/instances_actions.py b/trove/tests/api/instances_actions.py
index 8a95fe85..1b83e252 100644
--- a/trove/tests/api/instances_actions.py
+++ b/trove/tests/api/instances_actions.py
@@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
+import os
import time
from proboscis import after_class
@@ -26,6 +27,7 @@ from sqlalchemy.sql.expression import text
from troveclient.compat.exceptions import BadRequest
from troveclient.compat.exceptions import HTTPNotImplemented
+from trove.common import cfg
from trove.common.utils import poll_until
from trove import tests
from trove.tests.api.instances import assert_unprocessable
@@ -86,7 +88,17 @@ class MySqlConnection(object):
raise ex
-TIME_OUT_TIME = 15 * 60
+# Use default value from trove.common.cfg, and it could be overridden by
+# a environment variable when the tests run.
+def get_resize_timeout():
+ value_from_env = os.environ.get("TROVE_RESIZE_TIME_OUT", None)
+ if value_from_env:
+ return int(value_from_env)
+
+ return cfg.CONF.resize_time_out
+
+
+TIME_OUT_TIME = get_resize_timeout()
USER_WAS_DELETED = False