Testing guides

How to test a background job without arbitrary sleeps

An order message is processed, then its acknowledgement is lost.

How can we check completion and retries when processing finishes after the request returns?

Observe a durable state transition or event rather than sleeping for an assumed processing time. Give the test control over when the worker runs and when an acknowledgement arrives.

Work through the decision

When delivery repeats, a naive worker creates a second order. A fast happy-path assertion sees only the first one.

Steps and evidence for the reviewer
StepEvidence to keep
Enqueue onceCapture the business request key.
Replay deliveryKeep the business key and change the delivery ID.
Check terminal stateAssert one stored order and the expected completion event.

What changes the decision

Keep timeout and duplicate tests separate. A job can finish on time and still perform the business action twice.

Primary documentation

Your next release starts here

Keep building.
Put testing to work.

Give Cue April your next testing challenge. Let your AI quality lead coordinate the checks, so your team can focus on what comes next.

Create account

Create your account, connect a repository and review your proposed setup before approving a run.