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

add failed unittests retry (#26342)

上级 7e71ae92
......@@ -936,17 +936,96 @@ set +x
card_test "$multiple_card_tests" 2 # run cases with two GPUs
card_test "$exclusive_tests" # run cases exclusively, in this cases would be run with 4/8 GPUs
collect_failed_tests
if [ -n "${failed_test_lists}" ];then
failed_test_lists_ult=`echo "${failed_test_lists}" |grep -Po '[^ ].*$'`
echo "========================================"
echo "Summary Failed Tests... "
echo "========================================"
echo "The following tests FAILED: "
echo "${failed_test_lists_ult}"
fi
rm -f $tmp_dir/*
exec_times=0
retry_unittests_record=''
retry_time=3
exec_time_array=('first' 'second' 'third')
if [ -n "$failed_test_lists" ];then
while ( [ $exec_times -lt $retry_time ] && [ -n "${failed_test_lists}" ] )
do
retry_unittests_record="$retry_unittests_record$failed_test_lists"
failed_test_lists_ult=`echo "${failed_test_lists}" |grep -Po '[^ ].*$'`
read retry_unittests <<< $(echo "$failed_test_lists" | grep -oEi "\-.+\(\w+\)" | sed 's/(.\+)//' | sed 's/- //' )
echo "========================================="
echo "This is the ${exec_time_array[$exec_times]} time to re-run"
echo "========================================="
echo "The following unittest will be re-run:"
echo "${failed_test_lists_ult}"
for line in ${retry_unittests[@]} ;
do
one_card_tests=$single_card_tests'|'$single_card_tests_1
read tmp_one_tmp <<< "$( echo $one_card_tests | grep -oEi $line )"
read tmp_mul_tmp <<< "$( echo $multiple_card_tests | grep -oEi $line )"
read exclusive_tmp <<< "$( echo $exclusive_tests | grep -oEi $line )"
if [[ "$tmp_one_tmp" != "" ]]; then
if [[ "$one_card_retry" == "" ]]; then
one_card_retry="^$line$"
else
one_card_retry="$one_card_retry|^$line$"
fi
elif [[ "$tmp_mul_tmp" != "" ]]; then
if [[ "$multiple_card_retry" == "" ]]; then
multiple_card_retry="^$line$"
else
multiple_card_retry="$multiple_card_retry|^$line$"
fi
else
if [[ "$exclusive_retry" == "" ]];then
exclusive_retry="^$line$"
else
exclusive_retry="$exclusive_retry|^$line$"
fi
fi
done
if [[ "$one_card_retry" != "" ]]; then
card_test "$one_card_retry" 1
fi
if [[ "$multiple_card_retry" != "" ]]; then
card_test "$multiple_card_retry" 2
fi
if [[ "$exclusive_retry" != "" ]]; then
card_test "$exclusive_retry"
fi
exec_times=$[$exec_times+1]
failed_test_lists=''
collect_failed_tests
rm -f $tmp_dir/*
one_card_retry=''
multiple_card_retry=''
exclusive_retry=''
retry_unittests=''
done
fi
if [[ "$EXIT_CODE" != "0" ]]; then
exit 8;
if [[ "$failed_test_lists" == "" ]]; then
echo "========================================"
echo "There are failed tests, which have been successful after re-run:"
echo "========================================"
echo "The following tests have been re-ran:"
echo "${retry_unittests_record}"
else
failed_test_lists_ult=`echo "${failed_test_lists}" |grep -Po '[^ ].*$'`
echo "========================================"
echo "Summary Failed Tests... "
echo "========================================"
echo "The following tests FAILED: "
echo "${failed_test_lists_ult}"
exit 8;
fi
fi
set -ex
fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册