# failover: public failover test for every replica, file downloaded via the other one (make test-failover)
# date: 2026-11-07 15:59:02, commit: 5bfc53a + uncommitted changes
# command: python student-tests/run_failover.py
# exit code: 0, 40.8 s

hook: scripts/stop-one.sh; api replicas: ['api-1', 'api-2']
=== run 1: api containers before
api-1	api-1	Up (healthy)
api-2	api-2	Up (healthy)
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 131, "failed_attempts": 0, "first_recovery_seconds": 3.82}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
api containers after
api-1	api-1	Up (healthy)
api-2	api-2	Exited (0)
the hook stopped api-2 (the replica behind TARGET_INSTANCE_ID, mapped from its alias); other api containers kept running, postgres/redis/lb were not touched
restored: docker start api-2 -> healthy and back in HAProxy
=== run 2: api containers before
api-1	api-1	Up (healthy)
api-2	api-2	Up (healthy)
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 131, "failed_attempts": 0, "first_recovery_seconds": 3.721}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
api containers after
api-1	api-1	Exited (0)
api-2	api-2	Up (healthy)
the hook stopped api-1 (the replica behind TARGET_INSTANCE_ID, mapped from its alias); other api containers kept running, postgres/redis/lb were not touched
restored: docker start api-1 -> healthy and back in HAProxy
PASS: public failover test passed 2 times; every api replica was stopped once and restored
