Coding & developmentConcurrency testscode

Generate concurrency tests from a workflow

Exposes double-submit and race problems.

Editorial illustration for Generate concurrency tests from a workflow
Editorial illustration for this prompt; the prompt itself does not generate this image.

Ready to use

Prompt

From [WORKFLOW DESCRIPTION] and [STATE TRANSITIONS], produce a concurrency test plan for two or more actors: double-clicks, repeated callbacks, simultaneous edits, stale reads and retry after timeout. For each case, name initial state, interleaving, expected invariant and how to observe failure without corrupting production data. Include a tiny pseudocode harness using synthetic records, plus cleanup requirements. Do not assume an operation is idempotent merely because it usually succeeds. Return ten tests ranked by risk and identify which need a transaction or lock review.