forked from mtusi2026/mtusi2026lab2
feat: add evidence, report.md
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
# Отказы зависимостей и expiry на стенде
|
||||
# date: 2026-10-21T08:43:49Z
|
||||
# commit: 1d5c1e0 (dirty)
|
||||
|
||||
## 1. Redis остановлен: полный публичный smoke проходит через PostgreSQL
|
||||
$ docker compose stop redis
|
||||
Container messenger-lab2-redis-1 Stopping
|
||||
Container messenger-lab2-redis-1 Stopped
|
||||
|
||||
$ make test
|
||||
python3 tests/smoke.py --base-url "http://api:8080"
|
||||
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
|
||||
|
||||
$ docker compose start redis
|
||||
Container messenger-lab2-secrets-init-1 Starting
|
||||
Container messenger-lab2-secrets-init-1 Started
|
||||
Container messenger-lab2-secrets-init-1 Waiting
|
||||
Container messenger-lab2-secrets-init-1 Exited
|
||||
Container messenger-lab2-redis-1 Starting
|
||||
Container messenger-lab2-redis-1 Started
|
||||
|
||||
## 2. PostgreSQL остановлен: ограниченный 503 без внутренних деталей
|
||||
$ docker compose stop postgres
|
||||
Container messenger-lab2-postgres-1 Stopping
|
||||
Container messenger-lab2-postgres-1 Stopped
|
||||
|
||||
$ python3 scripts/probe.py status GET /health/ready
|
||||
GET /health/ready (anonymous) -> 503 {"error": {"code": "unavailable", "message": "database unavailable", "request_id": "a7bb2a68-b382-43cd-b9da-be82a9cf1ab0"}}
|
||||
|
||||
$ python3 scripts/probe.py status GET /api/v1/chats
|
||||
GET /api/v1/chats (anonymous) -> 401 {"error": {"code": "unauthorized", "message": "missing or invalid session", "request_id": "ae589529-992e-4f89-afc9-aef87a9ea438"}}
|
||||
|
||||
$ python3 scripts/probe.py status GET /api/v1/chats Bearer unknown-token
|
||||
GET /api/v1/chats (Bearer unknown-token) -> 503 {"error": {"code": "unavailable", "message": "database unavailable", "request_id": "8f2da39f-9f7e-4416-b07b-8c0f5ebc745c"}}
|
||||
|
||||
$ docker compose start postgres
|
||||
Container messenger-lab2-secrets-init-1 Starting
|
||||
Container messenger-lab2-secrets-init-1 Started
|
||||
Container messenger-lab2-secrets-init-1 Waiting
|
||||
Container messenger-lab2-secrets-init-1 Exited
|
||||
Container messenger-lab2-postgres-1 Starting
|
||||
Container messenger-lab2-postgres-1 Started
|
||||
|
||||
$ python3 scripts/probe.py ready
|
||||
ready
|
||||
|
||||
## 3. Redis после рестарта пуст (без persistence), сессии берутся из PostgreSQL
|
||||
$ docker compose restart redis
|
||||
Container messenger-lab2-redis-1 Restarting
|
||||
Container messenger-lab2-redis-1 Started
|
||||
|
||||
$ make test
|
||||
python3 tests/smoke.py --base-url "http://api:8080"
|
||||
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
|
||||
|
||||
## 4. Expiry: API пересоздан с SESSION_TTL_SECONDS=2
|
||||
$ docker compose exec -T api printenv SESSION_TTL_SECONDS
|
||||
2
|
||||
|
||||
$ python3 scripts/probe.py expiry 2
|
||||
register -> 201
|
||||
login -> 201 expires_at: 2026-10-21T08:44:17.766Z
|
||||
GET /api/v1/users/me (fresh) -> 200
|
||||
GET /api/v1/users/me (after 3s) -> 401
|
||||
|
||||
$ python3 scripts/probe.py ready
|
||||
ready
|
||||
|
||||
Reference in New Issue
Block a user