From 9fac5e5b055c930ffe6a341819eb26bb4ae9230f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A1=9C=E8=8F=AF?= Date: Mon, 29 May 2023 10:36:21 +0800 Subject: [PATCH] =?UTF-8?q?test=20=E8=B6=85=E6=99=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test.sh b/test.sh index 4e36231..962b844 100755 --- a/test.sh +++ b/test.sh @@ -92,14 +92,16 @@ while true; do message "$response" "獲取模型訓練進度 $progress% $status" # 如果進度爲 100, 訓練完成, 跳出循環 [[ $progress -eq 100 ]] && { echo "訓練完成"; break; } - # 休眠 5 秒 - sleep 5 + # 測試訓練時間不超過20秒, 超過則退出 + [[ $(($(date +%s) - $start_time)) -gt 20 ]] && exit_service "訓練時間超過20秒" + # 休眠 3 秒 + sleep 3 done + ## 模型列表 (GET /api/models) #response=$(curl -X GET -H "Content-Type: application/json" -b "session_id=$session_id" -s -w "%{http_code}" http://localhost:8080/api/models) #message "$response" "模型列表" -sleep 10 exit_service "測試結束, 全部通過, 用費時間: $(($(date +%s) - $start_time)) 秒"