A worker sends completed, times out waiting for a response, then sends the same event again. The dashboard shows two completions. One job finished.
You can catch this with three rows. This is a constructed fixture.
| Delivery | Job | Operation |
|---|---|---|
| d1 | j1 | complete |
| d2 | j1 | complete |
| d3 | j2 | complete |
Start with an empty store. Deliver d1, then d2, then d3. The completion count should read one, one, two. Swap d1 and d2 and repeat. The result should stay the same.
The useful distinction is between a delivery ID and the identity of the work. Deduplicating d1 against another d1 misses the retry sent as d2. For this fixture, each job can complete once, so use the job ID and operation as the uniqueness key. If a job can legitimately run again, include its run ID. Add a second fixture where two different runs of j1 each complete once. That catches the opposite error: a check that drops real work.
Finally, race two deliveries for the same completion. A check that reads the store before writing can let both through if both workers see an empty result. Exercise the actual write path and assert the number of stored completions. If the store supports unique keys, enforce the key at the write boundary and handle a duplicate as an already recorded completion.
You can count all three deliveries in a transport dashboard. Count the two completed jobs in a work dashboard. Keep the fixture next to the metric so the next person editing the query can see what each number is meant to count.
Here is a runnable control using Python's built-in SQLite module. The first table uses delivery identity. The second models one completion per run.
import sqlite3 with sqlite3.connect(":memory:") as db: db.execute("CREATE TABLE deliveries (id TEXT NOT NULL PRIMARY KEY)") db.execute("CREATE TABLE completed (run TEXT NOT NULL PRIMARY KEY)") for delivery, run in [("d1", "r1"), ("d2", "r1"), ("d3", "r2")]: db.execute("INSERT INTO deliveries VALUES (?)", (delivery,)) db.execute( "INSERT INTO completed VALUES (?) ON CONFLICT(run) DO NOTHING", (run,), ) counts = tuple( db.execute("SELECT COUNT(*) FROM " + table).fetchone()[0] for table in ("deliveries", "completed") ) assert counts == (3, 2), counts print(sqlite3.sqlite_version, counts) The SQLite UPSERT reference explains how the unique key governs the conflict. This fixture checks sequential duplicate delivery. Keep the separate race test for your own write path.

![Motion Planning and Navigation — Ch.11: Legged Robot Navigation [KR]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqftgs44jxvhe8fxlcrvt.png)