Skip to main content

Idempotency Testing

Idempotency testing verifies that making the same request multiple times produces the same result as making it once — critical for operations like payments or order creation, where a retried request (due to a network timeout, a client retry, a duplicate click) must not cause duplicate side effects.

A classic idempotency bug: a payment request times out on the client side, the client retries automatically, and the customer gets charged twice — even though from the client's perspective, it just "tried the same request again." Idempotent APIs prevent this by design, usually via a client-supplied idempotency key that the server uses to recognize and deduplicate repeated requests.

Testing this means deliberately sending the same request multiple times (including genuinely concurrent duplicates, not just sequential ones) and confirming only one side effect actually occurs — a test that only sends the request once will never catch a missing idempotency guarantee at all.

Idempotency Testing — Definition, Example & How It's Used | QA Bash Glossary | QA Bash