ЛР 2: PostgreSQL, сессии, Redis и исследование
Skeleton contracts / contracts (pull_request) Failing after 30s

This commit is contained in:
Никита
2026-10-06 13:34:34 +03:00
parent 65003b6119
commit 6a8908ab99
111 changed files with 6686 additions and 38 deletions
+25
View File
@@ -0,0 +1,25 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
base_url="${BASE_URL:-http://localhost:8080}"
python="${PYTHON:-python3}"
restore() {
docker compose up -d --no-deps --force-recreate api >/dev/null
}
trap restore EXIT
SESSION_TTL_SECONDS=2 docker compose up -d --no-deps --force-recreate api >/dev/null
attempt=0
until curl --fail --silent "$base_url/health/ready" >/dev/null; do
attempt=$((attempt + 1))
if [ "$attempt" -ge 30 ]; then
printf '%s\n' 'API did not become ready for expiry test.' >&2
exit 1
fi
sleep 1
done
"$python" student-tests/lab2_tests.py --base-url "$base_url" --check-expiry