# failover: public failover test for every replica, file downloaded via the other one (make test-failover)
# date: 2026-10-21 21:09:54, commit: 2dbed80 + uncommitted changes
# command: python.exe student-tests/run_failover.py
# exit code: 0, 39.7 s

hook: scripts\stop-one.cmd; api replicas: ['11a93acecaca', '6128eb268c44']
=== run 1: api containers before
SERVICE   CONTAINER ID   STATUS
api       11a93acecaca   Up 36 seconds (healthy)
api       6128eb268c44   Up 36 seconds (healthy)
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.

{"observed_instances_before": 2, "successful_writes": 126, "failed_attempts": 0, "first_recovery_seconds": 4.39}

PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
api containers after
SERVICE   CONTAINER ID   STATUS
api       11a93acecaca   Exited (0) 11 seconds ago
api       6128eb268c44   Up 53 seconds (healthy)
the hook stopped 11a93acecaca (X-Instance-Id of that replica = container ID); other api containers kept running, postgres/redis/lb were not touched
restored: docker start 11a93acecaca -> healthy and back in HAProxy
=== run 2: api containers before
SERVICE   CONTAINER ID   STATUS
api       11a93acecaca   Up 2 seconds (healthy)
api       6128eb268c44   Up 56 seconds (healthy)
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.

{"observed_instances_before": 2, "successful_writes": 124, "failed_attempts": 0, "first_recovery_seconds": 4.328}

PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
api containers after
SERVICE   CONTAINER ID   STATUS
api       11a93acecaca   Up 18 seconds (healthy)
api       6128eb268c44   Exited (0) 11 seconds ago
the hook stopped 6128eb268c44 (X-Instance-Id of that replica = container ID); other api containers kept running, postgres/redis/lb were not touched
restored: docker start 6128eb268c44 -> healthy and back in HAProxy
PASS: public failover test passed 2 times; every api replica was stopped once and restored
