未验证 提交 229f9308 编写于 作者: Y YUNSHEN XIE 提交者: GitHub

add retry on gcda_clean.py (#32318)

* add retry on gcda_clean.py

* add exit code for paddle_coverage.sh

* fix format error

* fix format error
上级 ead83422
......@@ -685,28 +685,23 @@ EOF
echo "ipipe_log_param_Mac_TestCases_Time: $[ $ut_endTime_s - $ut_startTime_s ]s" >> ${PADDLE_ROOT}/build/build_summary.txt
paddle version
# Recovery proxy to avoid failure in later steps
set +x
export http_proxy=$my_proxy
export https_proxy=$my_proxy
if [ "$mactest_error" != 0 ];then
show_ut_retry_result
fi
set -x
fi
}
function get_precision_ut_mac() {
on_precision=0
set -x
UT_list=$(ctest -N | awk -F ': ' '{print $2}' | sed '/^$/d' | sed '$d')
precison_cases=""
if [ ${PRECISION_TEST:-OFF} == "ON" ]; then
python3.7 $PADDLE_ROOT/tools/get_pr_ut.py
if [[ -f "ut_list" ]]; then
set +x
echo "PREC length: "`wc -l ut_list`
precision_cases=`cat ut_list`
set -x
fi
fi
if [ ${PRECISION_TEST:-OFF} == "ON" ] && [[ "$precision_cases" != "" ]];then
......
......@@ -18,6 +18,7 @@
import os
import sys
import time
from github import Github
......@@ -33,7 +34,18 @@ def get_pull(pull_id):
"""
token = os.getenv('GITHUB_API_TOKEN')
github = Github(token, timeout=60)
idx = 1
while idx < 4:
try:
repo = github.get_repo('PaddlePaddle/Paddle')
except Exception as e:
print(e)
print("get_repo error, retry {} times after {} secs.".format(
idx, idx * 10))
else:
break
idx += 1
time.sleep(idx * 10)
pull = repo.get_pull(pull_id)
return pull
......
......@@ -33,7 +33,7 @@ make install
cd /paddle/build
python3.7 ${PADDLE_ROOT}/tools/coverage/gcda_clean.py ${GIT_PR_ID}
python3.7 ${PADDLE_ROOT}/tools/coverage/gcda_clean.py ${GIT_PR_ID} || exit 101
lcov --capture -d ./ -o coverage.info --rc lcov_branch_coverage=0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册