forked from mtusi2026/mtusi2026lab2
Лабораторная 2: PostgreSQL, сессии, Valkey, трек 2
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
# Проверка expiry: пересоздаёт api с SESSION_TTL_SECONDS=2, гоняет tests_student/test_expiry.py, возвращает штатный TTL.
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
DC="docker compose --env-file .env"
|
||||
wait_healthy() { i=0; until [ "$(docker inspect -f '{{.State.Health.Status}}' "$($DC ps -q api)")" = "healthy" ]; do i=$((i+1)); [ $i -le 60 ] || exit 1; sleep 1; done; }
|
||||
trap 'SESSION_TTL_SECONDS= $DC up -d --force-recreate api >/dev/null; wait_healthy' EXIT
|
||||
SESSION_TTL_SECONDS=2 $DC up -d --force-recreate api; wait_healthy
|
||||
(cd tests_student && python3 test_expiry.py 2)
|
||||
Reference in New Issue
Block a user