mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
add 3 retries with 5s delay to db performance test
This commit is contained in:
parent
618e82cb4e
commit
b433d55d90
1 changed files with 26 additions and 14 deletions
40
.github/workflows/test-db-query-performance.yml
vendored
40
.github/workflows/test-db-query-performance.yml
vendored
|
|
@ -79,23 +79,35 @@ jobs:
|
|||
run: |
|
||||
echo "Testing: GET /user/daily/activity/aggregated?start_date=2026-02-01&end_date=2026-02-28&timezone=480"
|
||||
|
||||
http_code=$(curl --max-time 4 -s \
|
||||
-o /tmp/response.json \
|
||||
-w "%{http_code}" \
|
||||
-H "Authorization: Bearer sk-1234" \
|
||||
"http://localhost:4000/user/daily/activity/aggregated?start_date=2026-02-01&end_date=2026-02-28&timezone=480") \
|
||||
|| { echo "FAILED: request timed out after 4s"; docker logs litellm-test; exit 1; }
|
||||
max_attempts=3
|
||||
attempt=0
|
||||
|
||||
echo "Response (first 500 chars):"
|
||||
head -c 500 /tmp/response.json
|
||||
while [ $attempt -lt $max_attempts ]; do
|
||||
attempt=$((attempt + 1))
|
||||
echo "Attempt $attempt/$max_attempts..."
|
||||
|
||||
if [ "$http_code" -ne 200 ]; then
|
||||
echo "FAILED: expected HTTP 200, got $http_code"
|
||||
docker logs litellm-test
|
||||
exit 1
|
||||
fi
|
||||
http_code=$(curl --max-time 4 -s \
|
||||
-o /tmp/response.json \
|
||||
-w "%{http_code}" \
|
||||
-H "Authorization: Bearer sk-1234" \
|
||||
"http://localhost:4000/user/daily/activity/aggregated?start_date=2026-02-01&end_date=2026-02-28&timezone=480") \
|
||||
|| { echo "Attempt $attempt/$max_attempts timed out after 4s"; sleep 5; continue; }
|
||||
|
||||
echo "PASSED: endpoint returned HTTP 200 within 4s"
|
||||
echo "Response (first 500 chars):"
|
||||
head -c 500 /tmp/response.json
|
||||
|
||||
if [ "$http_code" -eq 200 ]; then
|
||||
echo "PASSED: endpoint returned HTTP 200 within 4s"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Attempt $attempt/$max_attempts failed: expected HTTP 200, got $http_code"
|
||||
sleep 5
|
||||
done
|
||||
|
||||
echo "FAILED: all $max_attempts attempts failed"
|
||||
docker logs litellm-test
|
||||
exit 1
|
||||
|
||||
- name: Cleanup
|
||||
if: always()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue