# balancing: balancing, shared sessions/data/files, X-Instance-Id
# date: 2026-11-01 20:42:35, commit: 470d9d6 + uncommitted changes
# command: python.exe student-tests/test_balancing.py
# exit code: 0, 2.1 s

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