Files
mtusi2026lab2/student-tests/README.md
T
gamayunov2004 18b419cda2
Student application / application (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
ЛР 2: PostgreSQL, сессии и Valkey — на 4
2026-10-23 18:17:09 +03:00

26 lines
1.6 KiB
Markdown

# Собственные проверки ЛР2
Только синтетический локальный стенд mtusi-lab2. Публичные tests/ не изменяются.
```sh
docker compose --env-file .env --profile test up -d --build --wait api api-expiry
docker compose --profile test run --rm tools sh scripts/run-checks.sh
```
`grade4.py core`: concurrent registration (12), parent INSERT followed by actual FK rollback,
strict contract negatives, 40 concurrent writes, equal timestamps, scoped keyset cursors,
read-after-write, auth, Unicode/colon password at 128 code points, real Valkey hits/TTL/refill/logout.
`expiry`: separate api-expiry process with SESSION_TTL_SECONDS=2, valid then expired token.
`explain`: inserts 10000 new rows into a dedicated chat, EXPLAIN ANALYZE BUFFERS at 3 positions,
then traverses all 100 pages through the real HTTP API.
`failures`: actually stops/starts Valkey and PostgreSQL of THIS project only; checks fallback,
503/401/404, bounded requests, recovery with old token, confirmed data and rejected write absence.
The tools container mounts the Docker socket to run operator fault/restart hooks; never deploy
it on a shared untrusted host or expose it as a public service. Normal API does not mount socket.
Evidence contains only summaries and query plans, no credentials or tokens.
`migrations` additionally compares all table counts and session expiry fingerprints before/after two migration runs.
`persistence_meta` verifies unchanged absolute expires_at after restarting all three services.
`python student-tests/load_measure.py` runs the public 15s load and samples scoped Docker stats during it.