Two requests work.
The third fails.
Choose a method, path, error body, and when the failure starts. Test whether your app retries, explains the problem, and avoids creating a duplicate record.
You can also inject latency and request-rate limits. Check the resulting app state, not just the response code.
// On an already-started Stripe clone:
await clone.injectError({
method: 'GET', path: '/v1/customers',
after: 2, rate: 1, status: 503,
body: { error: { type: 'api_error',
message: 'Service unavailable' } }
});
// The first two matching requests succeed.
// Later matching requests return this 503.