Pcornel
Automation · Idempotency

Idempotency Testing

Cheat sheet · https://pcornel.dk/topic.php?topic=6003

Back to the Topic

Answer

Idempotency testing runs an automation twice against the same system: the first run may change things, the second must report no changes. Molecule and CI pipelines do this automatically.

Remember

  • Run twice; second run must not change anything.
  • Automate in CI (Molecule).
  • Test on clean and existing systems.

First checks

  • molecule test — converge + idempotence
  • Run twice in CI and assert no changes — automation
  • terraform apply && terraform plan -detailed-exitcode — IaC check

Verify in this order

first run → second run → assert no changes

Where it usually breaks

Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6003

Confirmation

Confirm action

Continue?