Skip to main content
This guide shows how to introduce controlled chaos into your load tests to validate system resilience. Perfect for testing how your application handles failures and unexpected conditions.

Use Cases

  • Test system resilience under failures
  • Validate error handling and recovery
  • Check timeout behavior
  • Test circuit breaker patterns

Simple Implementation

Setup Instructions

  1. Configure chaos parameters (failure rate, scenarios)
  2. Define endpoints you want to test with chaos
  3. Adjust timeout values based on your system
  4. Monitor system behavior during chaos testing

What This Tests

  • Timeout Handling: How system responds to request timeouts
  • Error Recovery: System’s ability to recover from failures
  • Bad Input Handling: Response to malformed requests
  • Connection Failures: Behavior when connections fail

Chaos Scenarios

  • Timeouts: Very short request timeouts
  • Slow Responses: Artificially delayed requests
  • Connection Errors: Simulated network failures
  • Server Errors: Requests designed to trigger 5xx errors
  • Client Errors: Malformed requests causing 4xx errors

Monitoring During Chaos

Watch for:
  • Error Rates: Acceptable failure rates during chaos
  • Recovery Time: How quickly system recovers
  • Cascading Failures: Failures spreading to other services
  • Resource Usage: CPU/memory during failure scenarios

Safety Tips

  • Start Small: Begin with low failure rates
  • Monitor Closely: Watch system metrics during tests
  • Have Rollback: Be ready to stop chaos if needed
  • Test in Staging: Don’t run chaos in production initially