From 255b94d425c0e6bb6a78868b12e5ef1fb4346354 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Thu, 5 Mar 2015 15:35:52 -0600 Subject: [PATCH] Change testr to run in serial This change implements the change to allow testr to run in serial which should resolve most issues with tempest on a resource constrained host. The problem that is being resolved here is that testr will, by default, run in multi-threaded and has a relitively high probability to result in a 503. This primarily impacts the gate jobs as they are built on a hosts with 4 CPUs and 8GB of ram. By default if the tempest script is run, testr will run multi-threaded. However, if the environment variable RUN_TEMPEST_OPTS is set to '--serial' then it will run in serial. This is done for the gate-check-commit script so that the change only affects the AIO gate check. An additional environment variable TESTR_OPTS is added for further flexibility. Co-Authored-By: Jesse Pretorius Closes-Bug: #1428847 Change-Id: I8c7ac72ef46ae3f3af3d3503081bec0cbe7276e9 --- .../os_tempest/templates/openstack_tempest_gate.sh.j2 | 4 +++- scripts/gate-check-commit.sh | 3 +++ scripts/run-tempest.sh | 7 +++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/playbooks/roles/os_tempest/templates/openstack_tempest_gate.sh.j2 b/playbooks/roles/os_tempest/templates/openstack_tempest_gate.sh.j2 index 9e185e985b..7dfb527365 100644 --- a/playbooks/roles/os_tempest/templates/openstack_tempest_gate.sh.j2 +++ b/playbooks/roles/os_tempest/templates/openstack_tempest_gate.sh.j2 @@ -29,6 +29,8 @@ set -x test_list_name=${1:-commit_multinode} testr_ouput_lines=${testr_output_lines:-100} +RUN_TEMPEST_OPTS=${RUN_TEMPEST_OPTS:-''} +TESTR_OPTS=${TESTR_OPTS:-''} # -------------------- Functions ------------------------- @@ -138,7 +140,7 @@ test_list_summary="${test_list_name} ($(wc -l /dev/null || source $(dirname ${0})/scripts-library.sh @@ -43,5 +44,7 @@ pushd playbooks fi # Execute the tempest tests - ansible 'utility[0]' -m shell -a "${TEMPEST_SCRIPT_PATH} ${TEMPEST_SCRIPT_PARAMETERS}" + ansible 'utility[0]' -m shell -a "export RUN_TEMPEST_OPTS=${RUN_TEMPEST_OPTS}; \ + export TESTR_OPTS=${TESTR_OPTS}; \ + ${TEMPEST_SCRIPT_PATH} ${TEMPEST_SCRIPT_PARAMETERS}" popd