Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
6e5b9478
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
6e5b9478
编写于
5月 24, 2023
作者:
H
houj04
提交者:
GitHub
5月 24, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[XPU] add retry for unittests (#54044)
* [XPU] add retry for unittests * revert debug code.
上级
d7e64223
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
58 addition
and
2 deletion
+58
-2
paddle/scripts/paddle_build.sh
paddle/scripts/paddle_build.sh
+58
-2
未找到文件。
paddle/scripts/paddle_build.sh
浏览文件 @
6e5b9478
...
@@ -2235,14 +2235,70 @@ set +x
...
@@ -2235,14 +2235,70 @@ set +x
fi
fi
done
<<<
"
$test_cases
"
;
done
<<<
"
$test_cases
"
;
card_test
"
$single_card_tests
"
1
card_test
"
$single_card_tests
"
1
failed_test_lists
=
''
collect_failed_tests
collect_failed_tests
xputest_error
=
0
retry_unittests_record
=
''
retry_time
=
3
exec_times
=
0
exec_time_array
=(
'first'
'second'
'third'
)
exec_retry_threshold
=
10
is_retry_execuate
=
0
if
[
-n
"
$failed_test_lists
"
]
;
then
xputest_error
=
1
need_retry_ut_str
=
$(
echo
"
$failed_test_lists
"
|
grep
-oEi
"
\-
.+
\(
"
|
sed
's/(//'
|
sed
's/- //'
)
need_retry_ut_arr
=(
${
need_retry_ut_str
}
)
need_retry_ut_count
=
${#
need_retry_ut_arr
[@]
}
retry_unittests
=
$(
echo
"
$failed_test_lists
"
|
grep
-oEi
"
\-
.+
\(
"
|
sed
's/(//'
|
sed
's/- //'
)
if
[
$need_retry_ut_count
-lt
$exec_retry_threshold
]
;
then
while
(
[
$exec_times
-lt
$retry_time
]
)
do
set
+e
retry_unittests_record
=
"
$retry_unittests_record$failed_test_lists
"
failed_test_lists_ult
=
`
echo
"
${
failed_test_lists
}
"
`
set
-e
if
[[
"
${
exec_times
}
"
==
"1"
]]
;
then
if
[[
"
${
failed_test_lists
}
"
==
""
]]
;
then
break
else
retry_unittests
=
$(
echo
"
$failed_test_lists
"
|
grep
-oEi
"
\-
.+
\(
"
|
sed
's/(//'
|
sed
's/- //'
)
fi
fi
echo
"========================================="
echo
"This is the
${
exec_time_array
[
$exec_times
]
}
time to re-run"
echo
"========================================="
echo
"The following unittest will be re-run:"
echo
"
${
retry_unittests
}
"
echo
"========================================="
retry_unittests_regular
=
''
for
line
in
${
retry_unittests
[@]
}
;
do
if
[[
"
$retry_unittests_regular
"
==
""
]]
;
then
retry_unittests_regular
=
"^
$line
$"
else
retry_unittests_regular
=
"
$retry_unittests_regular
|^
$line
$"
fi
done
rm
-f
$tmp_dir
/
*
failed_test_lists
=
''
ctest
-R
"(
$retry_unittests_regular
)"
--output-on-failure
-j
$2
|
tee
$tmpfile
collect_failed_tests
exec_times
=
$[$exec_times
+1]
done
else
# There are more than 10 failed unit tests, so no unit test retry
is_retry_execuate
=
1
fi
fi
set
-x
set
-x
ut_endTime_s
=
`
date
+%s
`
ut_endTime_s
=
`
date
+%s
`
echo
"XPU testCase Time:
$[
$ut_endTime_s
-
$ut_startTime_s
]s"
echo
"XPU testCase Time:
$[
$ut_endTime_s
-
$ut_startTime_s
]s"
python
${
PADDLE_ROOT
}
/build/test/xpu/get_test_cover_info.py
python
${
PADDLE_ROOT
}
/build/test/xpu/get_test_cover_info.py
unset
XPU_OP_LIST_DIR
unset
XPU_OP_LIST_DIR
if
[
[
"
$EXIT_CODE
"
!=
"0"
]]
;
then
if
[
"
$xputest_error
"
!=
0
]
;
then
exit
8
;
show_ut_retry_result
fi
fi
fi
fi
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录