hard20 pts · first answer countsapi-testingdistributed-systems
Asserting on eventual consistency
After POST /orders, a GET /orders/{id} sometimes returns 404 for a short time because data is copied to a read replica. What is the best way to assert?
await expect.poll(async () => {
const r = await request.get('/orders/' + id)
return r.status()
}, { timeout: 10_000 }).toBe(200)Discussion 0
Join free to post in the discussion.
Related questions
- API or UI testAutomation Test Engineer
- Status code for a created resourceAutomation Test Engineer
- Which method is idempotentAutomation Test Engineer
- Why validate a JSON schemaAutomation Test Engineer
- Checking an API responseAutomation Test Engineer
- Reading a REST Assured testAutomation Test Engineer
- Tests fail after an hourAutomation Test Engineer
- 401 or 403Automation Test Engineer