Long-Running Operation and Asynchronous API Failures
HTTP 202 returned but the client assumes immediate completion; or the status-polling endpoint does not follow a consistent lifecycle contract.
Failure explanation
An API accepts work that cannot complete during the original request, but the client or provider mishandles the asynchronous lifecycle. HTTP 202 means the request was accepted for processing, not that the business operation succeeded. Problems include missing operation URLs, invalid polling behavior, undocumented state transitions, premature success, and terminal failures that are never exposed.
Example
POST /imports returns 202 Accepted and an operation ID. The client immediately displays “Import complete” without polling. The import later fails because several rows are invalid.
How to test
- Validate 202 response, operation identifier, status URL, and retry guidance.
- Poll through queued, running, succeeded, failed, and cancelled states.
- Test terminal states, expiration of operation resources, and repeated polling.
- Verify that state-specific fields and links match the contract.
Expected behavior
The client can distinguish accepted from completed work, and the operation resource provides a documented, reliable lifecycle and terminal outcome.
Runnable examples
Each example includes a broken server, a fixed server, an OpenAPI spec, and a clrsig scenario that detects the failure.
Learn how to find and fix it