Concurrent checkout / 31.32s

Two customers try to buy the last item.

Both customers start checkout while one item is left. One gets a reservation; the other sees that it is sold out.

About this film · test data

Recorded in July 2026 in the development environment using test data. The film preserves the interface and narration from that time; the linked guide explains the implementation and later changes. AI tools helped prepare this material.

Silent film with burned-in narrationOpen WebM directly
About this recording

A recording from the development environment using test data. This copy is preserved in the 16 July 2026 archive.

Related scenario: STK-002-DUAL in the film registry. The link identifies the scenario. The original test report and deployed version were not saved with this copy.

What to notice

  1. Two customer sessionsBoth start checkout against the same last available quantity.
  2. Requests overlapNeither journey waits for the other at the browser level.
  3. One reservation succeedsA conditional database update reserves the unit, allowing checkout to continue.
  4. One request fails clearlyThe stock condition then fails for the other request, so it creates no second reservation or order.

Why it matters

The stock check happens when the item is reserved. Seeing it in stock on the product page does not guarantee a reservation.

The customer-facing projection may be briefly stale without permitting oversell because Stock rechecks current database state.

Behind the scenes

Shopper AReserve quantity 1
→
Atomic stock checkavailable ≥ requested
←
Shopper BReserve quantity 1
→
Result for each requestAccepted hold or insufficient stock
Idempotency prevents one checkout from reserving twice. The availability predicate prevents independent checkouts from owning the same final unit.

What this film shows

On screen

Two overlapping browser journeys receive one success and one sold-out result.

How it works

The database update enforces the stock limit. The test does not use a browser lock to make the requests take turns.

Mechanism reference: reservation concurrency.

How we test changesRead about testing and deployment