Idempotent Test
A test that can run any number of times and always leave the system in a consistent, repeatable state.
What is Idempotent Test?
What is Idempotent Test?
An idempotent test produces the same result no matter how many times it runs, because it does not depend on or permanently alter shared state in ways that affect subsequent runs. Idempotency is a key ingredient of reliable automation: tests that leave residue—an extra record, a changed setting—cause the next run to behave differently and eventually flake. Achieving it means proper setup and teardown, isolated data, and clean-up on exit, so a suite can run repeatedly in CI without drifting into inconsistency.