CICD-349 · Failover testing
Encyclopedia · Distributed systems and reliability testing · All snippets
Previous · CICD-348 · Next · CICD-350
1. Where it fits
- Placement isolated lab terminal.
- Prerequisites disposable integration environment, synthetic traffic and controlled test faults.
- Platforms local-linux, github-actions, gitea-actions.
2. Copy the snippet
bash
docker compose stop primary
trap 'docker compose start primary' EXIT
pytest -q tests/test_replica_failover.py3. How it works
The command archives or inspects the selected files. Verify the relative paths and file set before using the archive downstream. Pytest discovers the selected test files or markers and returns a process exit status reflecting the test outcome.
4. Verify the result
The test should prove leader election and absence of duplicate writes. A healthy replica alone does not prove fenced failover.
Watch for. Confine the test and all synthetic traffic to an authorized, disposable lab. Check cleanup even after a failing assertion.
Validation syntax-validated (Bash parse). Status definitions.