44 lines
2.8 KiB
Plaintext
44 lines
2.8 KiB
Plaintext
### 2026-10-13T14:49:21Z финальный код (образ messenger-lab3-api:v2)
|
|
### docker compose ps
|
|
messenger-lab3-api-3 1ff54c0efa0c messenger-lab3-api:v2 Up About an hour (healthy)
|
|
messenger-lab3-api-4 fcae2c6047af messenger-lab3-api:v2 Up About an hour (healthy)
|
|
messenger-lab3-db-1 9d8a07ddc444 postgres:16.4-alpine Up 2 hours (healthy)
|
|
messenger-lab3-lb-1 087c5c4c9b74 haproxy:3.0.11-alpine Up 2 hours (healthy)
|
|
messenger-lab3-valkey-1 0f4951a33b71 valkey/valkey:8.0.1-alpine Up 2 hours (healthy)
|
|
### make check
|
|
python scripts/check_contract.py
|
|
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
|
### make test (хост -> LB localhost:8080)
|
|
python tests/smoke.py --base-url "http://localhost:8080"
|
|
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
|
|
### X-Instance-Id через LB (4 запроса подряд)
|
|
x-instance-id: fcae2c6047af
|
|
x-instance-id: 1ff54c0efa0c
|
|
x-instance-id: fcae2c6047af
|
|
x-instance-id: 1ff54c0efa0c
|
|
### make test-failover #1; реплики до:
|
|
messenger-lab3-api-4 fcae2c6047af Up About an hour (healthy)
|
|
messenger-lab3-api-3 1ff54c0efa0c Up About an hour (healthy)
|
|
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://lb:8080"
|
|
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
|
{"observed_instances_before": 2, "successful_writes": 129, "failed_attempts": 0, "first_recovery_seconds": 4.4}
|
|
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
|
### реплики после (остановленный контейнер):
|
|
messenger-lab3-api-4 fcae2c6047af Up About an hour (healthy)
|
|
messenger-lab3-api-3 1ff54c0efa0c Exited (0) 11 seconds ago
|
|
started api container 1ff54c0efa0c
|
|
running api replicas: 2
|
|
(перед вторым прогоном 1 лишний запрос через LB сдвигает round-robin, чтобы тест выбрал другую реплику)
|
|
### make test-failover #2; реплики до:
|
|
messenger-lab3-api-4 fcae2c6047af Up About an hour (healthy)
|
|
messenger-lab3-api-3 1ff54c0efa0c Up 7 seconds (healthy)
|
|
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://lb:8080"
|
|
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
|
{"observed_instances_before": 2, "successful_writes": 122, "failed_attempts": 0, "first_recovery_seconds": 4.52}
|
|
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
|
### реплики после (остановленный контейнер):
|
|
messenger-lab3-api-4 fcae2c6047af Exited (0) 11 seconds ago
|
|
messenger-lab3-api-3 1ff54c0efa0c Up 28 seconds (healthy)
|
|
started api container fcae2c6047af
|
|
running api replicas: 2
|