mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 16:48:03 +08:00
@@ -66,11 +66,25 @@ for dir in "${dirs[@]}"; do
|
||||
echo "Skipping disabled test: $test_file"
|
||||
continue
|
||||
fi
|
||||
|
||||
python -m coverage run "$test_file"
|
||||
# TODO: Add a framework to manage unit test execution time
|
||||
timeout 600 python -m coverage run "$test_file"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "$test_file" >> "$failed_tests_file"
|
||||
fail=$((fail + 1))
|
||||
|
||||
PORTS=($FLASK_PORT $FD_API_PORT $FD_ENGINE_QUEUE_PORT $FD_METRICS_PORT)
|
||||
echo "==== PORT CLEAN AFTER UT FAILED ===="
|
||||
|
||||
for port in "${PORTS[@]}"; do
|
||||
PIDS=$(lsof -t -i :$port)
|
||||
if [ -n "$PIDS" ]; then
|
||||
echo "Port $port is occupied by PID(s): $PIDS"
|
||||
echo "$PIDS" | xargs -r kill -9
|
||||
echo "Port $port cleared"
|
||||
else
|
||||
echo "Port $port is free"
|
||||
fi
|
||||
done
|
||||
else
|
||||
success=$((success + 1))
|
||||
fi
|
||||
|
Reference in New Issue
Block a user