server: tests: fix ci workflow

This commit is contained in:
Pierrick HYMBERT 2024-02-19 23:01:13 +01:00
parent 4e5245e6b8
commit 30aa323fb9
2 changed files with 12 additions and 2 deletions

View file

@ -46,6 +46,6 @@ jobs:
id: server_integration_test id: server_integration_test
run: | run: |
cd examples/server/tests cd examples/server/tests
./tests.sh tinyllama-2-1b-miniguanaco.Q2_K.gguf ./tests.sh ../../../tinyllama-2-1b-miniguanaco.Q2_K.gguf

View file

@ -6,7 +6,6 @@ then
exit 1 exit 1
fi fi
# kill the server at the end
cleanup() { cleanup() {
pkill -P $$ pkill -P $$
} }
@ -31,5 +30,16 @@ set -eu
--cont-batching \ --cont-batching \
"$@" & "$@" &
# Wait for the server to start
max_attempts=30
attempts=${max_attempts}
until curl --silent --fail "http://localhost:8080/health" | jq -r '.status' | grep ok; do
attempts=$(( attempts - 1));
[ "${attempts}" -eq 0 ] && { echo "Server did not startup" >&2; exit 1; }
sleep_time=$(( (max_attempts - attempts) * 2 ))
echo "waiting for server to be ready ${sleep_time}s..."
sleep ${sleep_time}
done
# Start tests # Start tests
behave behave