Skip to content

Commit 3ca174c

Browse files
committed
Add retry to FV and NV online tests
Relates-to: OLPEDGE-1131 Signed-off-by: Yaroslav Stefinko <[email protected]>
1 parent 8198e66 commit 3ca174c

File tree

2 files changed

+43
-5
lines changed

2 files changed

+43
-5
lines changed

scripts/linux/fv/gitlab-olp-cpp-sdk-functional-test.sh

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ node $REPO_HOME/tests/utils/mock_server/server.js & export SERVER_PID=$!
2525
# Add waiter for server to be started. No other way to solve that.
2626
# Curl returns code 1 - means server still down. Curl returns 0 when server is up
2727
RC=1
28-
while [ $RC -ne 0 ];
28+
while [[ ${RC} -ne 0 ]];
2929
do
3030
set +e
3131
curl -s http://localhost:3000
@@ -40,6 +40,26 @@ $REPO_HOME/build/tests/functional/olp-cpp-sdk-functional-tests \
4040
--gtest_output="xml:$REPO_HOME/reports/olp-functional-test-report.xml" \
4141
--gtest_filter="-ArcGisAuthenticationTest.SignInArcGis":"FacebookAuthenticationTest.SignInFacebook"
4242

43-
#Kill local server
44-
kill -15 $SERVER_PID
45-
wait $SERVER_PID # Waiter for server process to be exited correctly
43+
# Add retry to functional/online tests. Some online tests are flaky due to third party reason.
44+
result=$?
45+
count=0
46+
while [[ ${result} -ne 0 ]];
47+
do
48+
count=count+1
49+
echo "This is ${count} time retry ..."
50+
$REPO_HOME/build/tests/functional/olp-cpp-sdk-functional-tests \
51+
--gtest_output="xml:$REPO_HOME/reports/olp-functional-test-report.xml" \
52+
--gtest_filter="-ArcGisAuthenticationTest.SignInArcGis":"FacebookAuthenticationTest.SignInFacebook"
53+
result=$?
54+
55+
# Stop after 3 retry
56+
if [[ ${count} = 3 ]]; then
57+
break
58+
fi
59+
done
60+
# End of retry part. This part can be removed anytime.
61+
62+
# Kill local server
63+
kill -15 ${SERVER_PID}
64+
# Waiter for server process to be exited correctly
65+
wait ${SERVER_PID}

scripts/linux/nv/gitlab_test_valgrind.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,24 @@ do
8383
eval "${test_command}"
8484
result=$?
8585
echo "-----> Finished ${test_group_name} - Result=${result}"
86+
87+
# Add retry to functional/online tests. Some online tests are flaky due to third party reason.
88+
count=0
89+
while [[ ${result} -ne 0 && ${test_group_name} == "functional" ]];
90+
do
91+
count=count+1
92+
echo "This is ${count} time retry ..."
93+
echo "-----> Calling \"${test_command}\" for ${test_group_name} : "
94+
eval "${test_command}"
95+
result=$?
96+
echo "-----> Finished ${test_group_name} - Result=${result}"
97+
98+
# Stop after 3 retry
99+
if [[ ${count} = 3 ]]; then
100+
break
101+
fi
102+
done
103+
# End of retry part. This part can be removed anytime.
86104
}
87105
done
88106

@@ -139,4 +157,4 @@ echo "Artifacts download URL: ${CI_PROJECT_URL}-/jobs/${CI_JOB_ID}/artifacts/dow
139157

140158
if [[ ${result} -ne 0 ]]; then
141159
exit ${result}
142-
fi
160+
fi

0 commit comments

Comments
 (0)