Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
353dd0cd
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
353dd0cd
编写于
3月 02, 2021
作者:
Y
YUNSHEN XIE
提交者:
GitHub
3月 02, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Modified retry method on windows (#31363)
上级
59940cb3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
74 addition
and
6 deletion
+74
-6
tools/windows/run_unittests.sh
tools/windows/run_unittests.sh
+74
-6
未找到文件。
tools/windows/run_unittests.sh
浏览文件 @
353dd0cd
...
@@ -251,6 +251,78 @@ function run_unittest() {
...
@@ -251,6 +251,78 @@ function run_unittest() {
wait
;
wait
;
}
}
function
unittests_retry
(){
parallel_job
=
1
is_retry_execuate
=
0
wintest_error
=
1
retry_time
=
3
exec_times
=
0
exec_retry_threshold
=
10
retry_unittests
=
$(
echo
"
${
failed_test_lists
}
"
|
grep
-oEi
"
\-
.+
\(
"
|
sed
's/(//'
|
sed
's/- //'
)
need_retry_ut_counts
=
$(
echo
"
$ut_lists
"
|awk
-F
' '
'{print }'
|
sed
'/^$/d'
|
wc
-l
)
retry_unittests_regular
=
$(
echo
"
$retry_unittests
"
|awk
-F
' '
'{print }'
|
awk
'BEGIN{ all_str=""}{if (all_str==""){all_str=$1}else{all_str=all_str"$|^"$1}} END{print "^"all_str"$"}'
)
if
[
$need_retry_ut_counts
-lt
$exec_retry_threshold
]
;
then
retry_unittests_record
=
''
while
(
[
$exec_times
-lt
$retry_time
]
)
do
retry_unittests_record
=
"
$retry_unittests_record$failed_test_lists
"
if
(
[[
"
$exec_times
"
==
"0"
]]
)
;
then
cur_order
=
'first'
elif
(
[[
"
$exec_times
"
==
"1"
]]
)
;
then
cur_order
=
'second'
elif
(
[[
"
$exec_times
"
==
"1"
]]
)
;
then
cur_order
=
'third'
fi
echo
"========================================="
echo
"This is the
${
cur_order
}
time to re-run"
echo
"========================================="
echo
"The following unittest will be re-run:"
echo
"
${
retry_unittests
}
"
echo
"========================================="
rm
-f
$tmp_dir
/
*
failed_test_lists
=
''
ctest
-R
"(
$retry_unittests_regular
)"
--output-on-failure
-C
Release
-j
$parallel_job
|
tee
$tmpfile
collect_failed_tests
exec_times
=
$(
echo
$exec_times
|
awk
'{print $0+1}'
)
done
else
# There are more than 10 failed unit tests, so no unit test retry
is_retry_execuate
=
1
fi
rm
-f
$tmp_dir
/
*
}
function
show_ut_retry_result
()
{
if
[[
"
$is_retry_execuate
"
!=
"0"
]]
;
then
failed_test_lists_ult
=
`
echo
"
${
failed_test_lists
}
"
|
grep
-Po
'[^ ].*$'
`
echo
"========================================="
echo
"There are more than 10 failed unit tests, so no unit test retry!!!"
echo
"========================================="
echo
"
${
failed_test_lists_ult
}
"
exit
8
;
else
retry_unittests_ut_name
=
$(
echo
"
$retry_unittests_record
"
|
grep
-oEi
"
\-
.+
\(
"
|
sed
's/(//'
|
sed
's/- //'
)
retry_unittests_record_judge
=
$(
echo
${
retry_unittests_ut_name
}
|
tr
' '
'\n'
|
sort
|
uniq
-c
|
awk
'{if ($1 >=3) {print $2}}'
)
if
[
-z
"
${
retry_unittests_record_judge
}
"
]
;
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_ut_re
=
$(
echo
"
${
retry_unittests_record_judge
}
"
|
awk
'BEGIN{ all_str=""}{if (all_str==""){all_str=$1}else{all_str=all_str"|"$1}} END{print all_str}'
)
echo
"========================================"
echo
"There are failed tests, which have been executed re-run,but success rate is less than 50%:"
echo
"Summary Failed Tests... "
echo
"========================================"
echo
"The following tests FAILED: "
echo
"
${
retry_unittests_record
}
"
|
grep
-E
"
$failed_ut_re
"
exit
8
;
fi
fi
}
set
+e
set
+e
run_unittest
$eight_parallel_job
8
run_unittest
$eight_parallel_job
8
run_unittest
$tetrad_parallel_jog
4
run_unittest
$tetrad_parallel_jog
4
...
@@ -260,10 +332,6 @@ collect_failed_tests
...
@@ -260,10 +332,6 @@ collect_failed_tests
set
-e
set
-e
rm
-f
$tmp_dir
/
*
rm
-f
$tmp_dir
/
*
if
[[
"
$failed_test_lists
"
!=
""
]]
;
then
if
[[
"
$failed_test_lists
"
!=
""
]]
;
then
echo
"========================================"
unittests_retry
echo
"Summary Failed Tests... "
show_ut_retry_result
echo
"========================================"
echo
"The following tests FAILED: "
echo
"
${
failed_test_lists
}
"
exit
8
fi
fi
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录