python-chaos-test

Inject network and dependency faults into ephemeral test environments with pytest, toxiproxy-python, and testcontainers.

1|Updated Jun 20, 2026
One-click install
npx skills add https://github.com/shafibabar/SDLC-Artifact-Factory --skill python-chaos-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-chaos-test
Source: https://github.com/shafibabar/SDLC-Artifact-Factory/tree/main/skills/python-chaos-test
Command: npx skills add https://github.com/shafibabar/SDLC-Artifact-Factory --skill python-chaos-test

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires toxiproxy-python, testcontainers, aiokafka, asyncpg, pytest, pytest-asyncio, and includes references (resource) components.

What problem does it solve?

This Skill addresses the gap between theoretical resilience patterns and their actual effectiveness by injecting controlled, isolated faults to verify that your system recovers as expected.

Core Features & Use Cases

  • Frugal Fault Injection: Uses toxiproxy and testcontainers to simulate network partitions, latency, and dependency failures without requiring a heavy chaos platform.
  • Hypothesis-Driven Testing: Enforces a strict four-part experiment structure (steady state, hypothesis, blast radius, rollback) to ensure every test provides a clear pass/fail verdict.
  • Use Case: Verify that your Circuit Breaker correctly opens when a database link is severed and that your event consumer resumes from the correct offset after a broker restart.

Quick Start

Use the python-chaos-test skill to design and run a new resilience experiment for the event consumer service.

Frequently Asked Questions about python-chaos-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I inject network faults to test Python service resilience without a heavy chaos platform?

To test Python service resilience, inject controlled network faults using toxiproxy and testcontainers within pytest to simulate latency and dependency failures deterministically in ephemeral environments, avoiding the need for a heavy chaos platform.

What is the best way to verify if a circuit breaker opens when a database link is severed?

Verifying circuit breaker behavior during a database link failure requires hypothesis-driven fault injection. You define a steady state, inject the fault via toxiproxy, and confirm the circuit breaker opens correctly within the isolated blast radius.

Does fault injection testing work with asynchronous event consumers like aiokafka?

Fault injection testing supports asynchronous event consumers. By combining toxiproxy with pytest-asyncio and aiokafka, you can simulate broker restarts and verify that consumers successfully resume processing from the correct offset.

How do I structure a chaos engineering experiment to ensure a clear pass or fail verdict?

Structuring a chaos engineering experiment for a clear pass or fail verdict requires a strict four-part hypothesis: define the steady state, formulate the hypothesis, establish the blast radius, and configure automated rollback triggers.

Do I need pytest and testcontainers to run deterministic network partition tests in Python?

You need pytest and testcontainers to execute deterministic network partition tests in Python. These dependencies facilitate ephemeral environment creation and structured fault-injection experiments with automated rollback triggers.