# balancing: balancing, shared sessions/data/files, X-Instance-Id
# date: 2026-11-07 19:43:46, commit: 20afc2c + uncommitted changes
# command: python.exe student-tests/test_balancing.py
# exit code: 0, 3.5 s

20 x GET /users/me with one token -> replicas: {'f9e5ac61cde6': 10, '708b4b92f569': 10}
PASS: one session works on every replica, no second login (sessions are shared in Redis)
message written by 708b4b92f569; read back by ['708b4b92f569', 'f9e5ac61cde6']
PASS: a message written via one replica is read right away via another (shared PostgreSQL)
logout on f9e5ac61cde6; old token then rejected by ['708b4b92f569', 'f9e5ac61cde6']
PASS: logout on one replica revokes the session on all of them
first POST on f9e5ac61cde6 -> 201 b67e1df0-7002-437c-ba25-1ca953b58180; same key on 708b4b92f569 -> 201 b67e1df0-7002-437c-ba25-1ca953b58180
PASS: Idempotency-Key is shared: a retry through another replica returns the same message
file uploaded via f9e5ac61cde6; downloaded byte for byte via ['708b4b92f569', 'f9e5ac61cde6']
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 replica ['708b4b92f569', 'f9e5ac61cde6']; api containers -> aliases: {'0c7893e1043d': '708b4b92f569', 'b7f37f051ba1': 'f9e5ac61cde6'}
PASS: X-Instance-Id is in every response and points to a real container
6 passed, 0 failed
