Marco Garofalo
09/14/2026, 1:03 PMktor-client-chaos is a lightweight, expressive chaos testing engine for Ktor HTTP clients.
Inject latency, simulate server faults, test client-side timeouts, throw network errors, and script multi-stage failure scenarios with an intuitive Kotlin DSL to verify the resilience of your HTTP integrations.
🎯 Why Chaos Testing for HTTP Clients?
When building distributed systems and microservices, third-party APIs and upstream services will fail, slow down, drop connections, or hang indefinitely.
ktor-client-chaos helps you test:
• Retry Mechanisms: Does your client back off and retry on`503 Service Unavailable`or transient socket exceptions?
• Timeouts & Circuit Breakers: Does your client correctly abort hung connections when upstream calls suspend or stream forever?
• Fallback Logic & Degradation: Does your application gracefully handle empty payloads or HTTP error codes?
• Multi-Stage Outages: Can your service recover after an outage transitions from failures back to healthy responses?
• Outside-In Testing with Fakes: Can you test full end-to-end flows using reusable fake upstreams without managing dynamic localhost ports or brittle mocks?