From e3d891a477f8c9b23ea9b69a3312be23d665ff3c Mon Sep 17 00:00:00 2001 From: zhongzhuonan <47878719+zhongzhuonan@users.noreply.github.com> Date: Thu, 21 Mar 2024 14:22:30 +0800 Subject: [PATCH] Update self-hosted.yml (#687) add a TIMEOUT for TIM-VX check. If this step fails, there is a high probability that the local board has problems.There is a TIMEOUT to find problems faster. --- .github/workflows/self-hosted.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml index 0a83548..9010a61 100644 --- a/.github/workflows/self-hosted.yml +++ b/.github/workflows/self-hosted.yml @@ -37,8 +37,21 @@ jobs: steps: - name: check_TIM-VX_result run: | + start_time=$(date +%s) + max_duration=3600 + while true do + current_time=$(date +%s) + + elapsed_time=$((current_time - start_time)) + + if [[ $elapsed_time -ge $max_duration ]];then + echo "TIM-VX result check has exceeded 1 hour." + echo "Please check the local board." + exit 1 + fi + if [[ -e /home/vip_sqa/build_case/result/TIM-VX_unit_test_qua.txt ]];then total_num=`cat /home/vip_sqa/build_case/result/TIM-VX_unit_test_qua.txt | grep "Total" | awk -F ':' '{print $2}' | sed 's/ //g'` pass_num=`cat /home/vip_sqa/build_case/result/TIM-VX_unit_test_qua.txt | grep "Pass" | awk -F ':' '{print $2}' | sed 's/ //g'`