test 超時

This commit is contained in:
2023-05-29 10:36:21 +08:00
parent 472c6497f8
commit 9fac5e5b05

View File

@@ -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))"