# balancing: balancing, shared sessions/data/files, X-Instance-Id
# date: 2026-10-22 14:22:27, commit: c942c61 + uncommitted changes
# command: python.exe student-tests/test_balancing.py
# exit code: 0, 2.0 s

20 x GET /users/me with one token -> replicas: {'d590adc21943': 10, '343119df2488': 10}
PASS: one session works on every replica, no second login (sessions are shared in Redis)
message written by 343119df2488; read back by ['343119df2488', 'd590adc21943']
PASS: a message written via one replica is read right away via another (shared PostgreSQL)
logout on d590adc21943; old token then rejected by ['343119df2488', 'd590adc21943']
PASS: logout on one replica revokes the session on all of them
first POST on d590adc21943 -> 201 6c2f624d-c728-4738-b486-b17ab735c0ae; same key on 343119df2488 -> 201 6c2f624d-c728-4738-b486-b17ab735c0ae
PASS: Idempotency-Key is shared: a retry through another replica returns the same message
file uploaded via d590adc21943; downloaded byte for byte via ['343119df2488', 'd590adc21943']
PASS: a file uploaded through one replica is downloaded through another (shared S3, nothing local)
statuses [200, 200, 201, 400, 401, 404, 409]: every answer has X-Instance-Id of a running container ['343119df2488', 'd590adc21943']; api containers: ['343119df2488', 'd590adc21943']
PASS: X-Instance-Id is in every response and points to a real container
6 passed, 0 failed
