@@ -46,7 +46,7 @@ ulimit -c unlimited
4646# Stop after 2nd retry.
4747source ${FV_HOME} /olp-cpp-sdk-functional-test.variables
4848set +e
49- for RETRY_COUNT in 1 2
49+ for RETRY_COUNT in 1 2 3
5050do
5151 echo " This is (${RETRY_COUNT} ) time run ..."
5252
5555
5656 if [[ $? -eq 1 ]]; then
5757 # Functional test failed with exit code 1 means some tests failed
58+ # But we handle flacky test and repeat up to 3 times
5859 TEST_FAILURE=1
5960 sleep 10
61+ elif [[ $? -gt 1 ]]; then
62+ # Functional test crashed
63+ result=$?
64+ set -e
65+ exit $result
6066 else
6167 # Return to success
6268 TEST_FAILURE=0
6369 break
6470 fi
6571done
66- set -e
6772# End of retry part. This part can be removed any time later or after all online tests are stable.
6873
6974# Run functional tests with Mock Server
@@ -88,19 +93,18 @@ ${FV_HOME}/gitlab-olp-cpp-sdk-dataservice-write-test.sh || TEST_FAILURE=1
8893
8994
9095# Lines below are added for pretty data sum-up and finalize results of this script is case of FAILURE
91- set +x # to avoid dirty output at the end on logs
92- if [[ ${TEST_FAILURE} == 1 ]] ; then
93- export REPORT_COUNT=$( ls ${REPO_HOME} /reports | wc -l)
94- if [[ ${REPORT_COUNT} -ne ${EXPECTED_REPORT_COUNT} || ${REPORT_COUNT} == 0 ]]; then
95- echo " ##################################################################################################"
96- echo " CRASH ERROR. One of test groups contains crash. Report was not generated for that group ! "
97- echo " ##################################################################################################"
98- fi
96+ # set +x to avoid dirty output at the end on logs
97+ set +x
98+ export REPORT_COUNT=$( ls ${REPO_HOME} /reports | wc -l)
99+ if [[ ${REPORT_COUNT} -ne ${EXPECTED_REPORT_COUNT} || ${REPORT_COUNT} == 0 ]]; then
100+ echo " ##################################################################################################"
101+ echo " CRASH ERROR. One of test groups contains crash. Report was not generated for that group ! "
102+ echo " ##################################################################################################"
103+ TEST_FAILURE=1
99104else
100105 echo " OK. Full list of test reports was generated. "
101106fi
102107
103-
104108for failreport in $( ls ${REPO_HOME} /reports/* .xml)
105109do
106110 echo " Parsing ${failreport} ..."
0 commit comments