API fault injection · Simulate API errors

Put your failure paths to the test.

Find out what happens when a dependency stops cooperating. Simulate API errors, rate limits and response delays, and see how your application handles the interruption.

14-day Pro trial. Runs on Docker Compose in your environment. See pricing

Failure injection: an illustrative interactionIllustrative conditions: an API error and a delayed response. Your client decides how to react.CHOOSE THE API CONDITIONYour clientrequestConfigured error503ORResponse delayYour chosen waitInspect retry, timeout and fallback.
  • Self-hosted
  • Runs on Docker Compose
  • Built from real API traffic
  • Your test data, your control
  • Use the tests you already run

What this makes testable

Choose the error

Return a configured failure response when you need to exercise the recovery branch of your client.

Test the wait

Add controlled latency and inspect the timeout, loading state or fallback your application actually uses.

Keep policy yours

Test API retry logic with your existing tests: check retry limits and effects rather than assuming a later request is safe.

Recovery is application behavior

Make the failure useful to your test.

A slow response can expose a frozen loading state. A 503 can reveal a missing fallback. Put those conditions within reach while your application is still under development.

Start from a preset or tune a rule for one endpoint. Your own tests decide whether the recovery is good enough.

  • Normal controlContinue the workflow
  • Configured 503Inspect fallback and effects
  • Response delayInspect timeout behavior
  • Rate-limited preset (429)Inspect backoff and Retry-After handling

Chaos testing

Chaos testing at the API boundary.

Chaos testing asks what your application does when something it depends on fails. Gostly runs that experiment where your service meets the APIs it calls. Return errors on a share of requests, slow the answers down, or switch on an intermittent outage: stretches of normal responses broken by short bursts of failures.

Each fault is a rule you set for a service or for one endpoint, so the same experiment runs on a laptop and in CI. This covers the API responses your code receives. Faults in your own instances, containers and network belong to infrastructure chaos tools.

  • Errors on a share of requestsInspect retries and their effects
  • A band of added latencyInspect timeouts and loading states
  • Intermittent outage presetInspect recovery after each burst

Resilience testing

Resilience testing for the calls your service makes.

Resilience testing checks the client side of an API call: the retry, the timeout and the fallback. Serve a 503, a rate limit with Retry-After or a slow response, then assert what your code did next: how often it retried, when it gave up and what the user saw.

Fault tolerance testing is the same exercise with a pass mark. Under the failure you chose, the workflow still finishes, or it fails in the way you designed. Your tests hold that mark, and Gostly supplies the failure on demand.

  • RetryCount attempts and repeated writes
  • TimeoutCheck when the client gives up
  • FallbackCheck what the user is shown

FAQ

Does Gostly perform the retry?

Your client or test harness decides when and whether to retry. A configured error or Retry-After value does not establish that repeating a mutation is safe.

Where do the fault rules apply?

Chaos configuration applies in MOCK and PASSTHROUGH, with selectable modes and endpoint overrides. An injected error can answer before normal response selection; it need not read a recording first.

Does this reproduce every kind of outage?

Use it for supported response errors, latency and configured API conditions. Network packet loss, your application internals and every possible production failure are separate testing boundaries.

How does the trial work?

Every new account starts a 14-day Pro trial automatically, with no credit card required. A subscription is required after the trial.

Resources

Go deeper on failure injection

Plan a retry test

Separate a failed response from a safe repeat and inspect your client’s resulting actions.

Explore the worked specification

Start with a fault preset

Find a supported starting condition for errors, latency and rate-limit behavior.

Browse the presets

Tune the condition

Review service rules, endpoint overrides and configuration details for your selected case.

Read configuration details

Give recovery a real test case.

Choose one failure your application needs to handle. Run it with your own caller and inspect the response and the resulting effect.