# balancing: balancing, shared sessions and data, X-Instance-Id
# date: 2026-10-14 20:24:12, commit: 0ab3a34 + uncommitted changes
# command: python.exe student-tests/test_balancing.py
# exit code: 0, 1.3 s

20 x GET /users/me with one token -> replicas: {'9737b915ff2f': 10, '58542a53644c': 10}
PASS: one session works on every replica, no second login (sessions are shared in Redis)
message written by 58542a53644c; read back by ['58542a53644c', '9737b915ff2f']
PASS: a message written via one replica is read right away via another (shared PostgreSQL)
logout on 9737b915ff2f; old token then rejected by ['58542a53644c', '9737b915ff2f']
PASS: logout on one replica revokes the session on all of them
first POST on 9737b915ff2f -> 201 a8111033-9f9c-4d32-8260-ec76d289aace; same key on 58542a53644c -> 201 a8111033-9f9c-4d32-8260-ec76d289aace
PASS: Idempotency-Key is shared: a retry through another replica returns the same message
statuses [200, 200, 201, 400, 401, 404, 409]: every answer has X-Instance-Id of a running container ['58542a53644c', '9737b915ff2f']; api containers: ['58542a53644c', '9737b915ff2f']
PASS: X-Instance-Id is in every response and points to a real container
5 passed, 0 failed
