CICD-342 · Service dependency failure testing
Encyclopedia · Distributed systems and reliability testing · All snippets
Previous · CICD-341 · Next · CICD-343
1. Where it fits
- Placement isolated compose CI job.
- Prerequisites disposable integration environment, synthetic traffic and controlled test faults.
- Platforms local-linux, github-actions, gitea-actions.
2. Copy the snippet
bash
docker compose pause dependency
trap 'docker compose unpause dependency' EXIT
pytest -q tests/test_dependency_timeout.py3. How it works
Pytest discovers the selected test files or markers and returns a process exit status reflecting the test outcome.
4. Verify the result
The client sees a slow peer rather than a clean disconnect. Assert a bounded timeout plus controlled error.
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.