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 <jesse.pretorius@rackspace.co.uk>
Closes-Bug: #1428847
Change-Id: I8c7ac72ef46ae3f3af3d3503081bec0cbe7276e9
This commit is contained in:
Kevin Carter 2015-03-05 15:35:52 -06:00 committed by Jesse Pretorius
parent e2d6ee0780
commit 255b94d425
3 changed files with 11 additions and 3 deletions

View File

@ -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 <test_list) tests)"
echo "Using test list $test_list_summary"
# execute chosen tests with pretty output
./run_tempest.sh --no-virtual-env -- --load-list test_list;
./run_tempest.sh --no-virtual-env ${RUN_TEMPEST_OPTS} -- --load-list test_list ${TESTR_OPTS};
result=$?
popd

View File

@ -39,6 +39,9 @@ export MAX_RETRIES=${MAX_RETRIES:-"1"}
# limit forks for gate check
export FORKS=${FORKS:-10}
export SYMLINK_DIR=${SYMLINK_DIR:-"$(pwd)/logs"}
# tempest and testr options, default is to run tempest in serial
export RUN_TEMPEST_OPTS=${RUN_TEMPEST_OPTS:-'--serial'}
export TESTR_OPTS=${TESTR_OPTS:-''}
## Functions -----------------------------------------------------------------

View File

@ -20,7 +20,8 @@ set -e -u -v +x
## Vars ----------------------------------------------------------------------
export TEMPEST_SCRIPT_PATH=${TEMPEST_SCRIPT_PATH:-/opt/openstack_tempest_gate.sh}
export TEMPEST_SCRIPT_PARAMETERS=${TEMPEST_SCRIPT_PARAMETERS:-""}
export RUN_TEMPEST_OPTS=${RUN_TEMPEST_OPTS:-''}
export TESTR_OPTS=${TESTR_OPTS:-''}
## Library Check -------------------------------------------------------------
info_block "Checking for required libraries." 2> /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