The run lifecycle
A run is one scenario’s coordinated test, from its opening to the end of its cleanup.
Diagram: The run lifecycle. While a run is opened, its dispatchers prepare until the readiness gate opens and the traffic flows; then it moves to traffic-complete, settled, cleanup and closed. Two side paths lead to cleanup: failed, when the gate cannot open, and abandoned, when the suite goes silent or gives the run up. A cleanup still going at the cleanup deadline closes unfinished.
1/10opened. The suite opens a run for a group, naming the dispatchers it requires. Every live instance of every dispatcher in the group is put on the run, and notified (run.opened).
2/10preparing. The suite declares what its streams will create, and each dispatcher declares what its systems will derive from that, in rounds, until a round adds nothing (run.footprint-updated).
3/10ready. The readiness gate opens: every required instance has prepared, in a round that began from the footprint’s version now.
4/10traffic. The suite sends the traffic at its declared rates, and renews its lease throughout.
5/10traffic-complete. The suite says its traffic is done, and the run’s window closes (run.traffic-complete).
6/10settled. The suite says the run has settled, once its checks are done (run.settled). Draining downstream is the scenario’s to wait for, such as a consumer group catching up.
7/10cleanup. Every dispatcher removes what its systems created and proves it, in rounds, until each is complete (run.cleanup-ready).
8/10closed. Every instance completed, or is unreachable, on the footprint as it is now. The orchestrator closes the run. A cleanup still going at the cleanup deadline (24 h) closes unfinished.
9/10failed. The gate cannot open: a required instance is blocked, unreachable or silent, or the readiness timeout passes. The run goes to cleanup all the same, so whatever was prepared is removed.
10/10abandoned. The suite stops renewing its lease, because its runner died, or gives the run up, because its scenario failed. The run goes to cleanup. Silence is a signal, and the mess is still someone’s.
┌────────┐ ┌───────────┐ ┌───────┐ ┌─────────┐ ┌──────────────────┐ │ opened ├──>│ preparing ├──>│ ready ├──>│ traffic ├──>│ traffic-complete │ └────────┘ └─────┬─────┘ └───────┘ └─────────┘ └─────────┬────────┘ │ │ │ │ │ │ │ │ │ v │ ┌────────┐ ┌─────────┐ ┌─────────┐ │ │ closed │<───────┤ cleanup │<────────┤ settled │ │ └────────┘ └─────────┘ └─────────┘ │ ^ ^ │ │ │ │ │ │ v │ │ ┌────────┐ │ │ ┌───────────┐ │ failed ├───────────────────┘ └────┤ abandoned │ └────────┘ └───────────┘ the gate cannot open the suite goes silent or gives up
┌────────┐ ┌───────────┐ ┌───────┐ ┌─────────┐ ┌──────────────────┐ │ opened ├──>│ preparing ├──>│ ready ├──>│ traffic ├──>│ traffic-complete │ └────────┘ └─────┬─────┘ └───────┘ └─────────┘ └─────────┬────────┘ │ │ │ │ │ │ │ │ │ v │ ┌────────┐ ┌─────────┐ ┌─────────┐ │ │ closed │<───────┤ cleanup │<────────┤ settled │ │ └────────┘ └─────────┘ └─────────┘ │ ^ ^ │ │ │ │ │ │ v │ │ ┌────────┐ │ │ ┌───────────┐ │ failed ├───────────────────┘ └────┤ abandoned │ └────────┘ └───────────┘ the gate cannot open the suite goes silent or gives up
┌────────┐ ┌───────────┐ ┌───────┐ ┌─────────┐ ┌──────────────────┐ │ opened ├──>│ preparing ├──>│ ready ├──>│ traffic ├──>│ traffic-complete │ └────────┘ └─────┬─────┘ └───────┘ └─────────┘ └─────────┬────────┘ │ │ │ │ │ │ │ │ │ v │ ┌────────┐ ┌─────────┐ ┌─────────┐ │ │ closed │<───────┤ cleanup │<────────┤ settled │ │ └────────┘ └─────────┘ └─────────┘ │ ^ ^ │ │ │ │ │ │ v │ │ ┌────────┐ │ │ ┌───────────┐ │ failed ├───────────────────┘ └────┤ abandoned │ └────────┘ └───────────┘ the gate cannot open the suite goes silent or gives up
┌────────┐ ┌───────────┐ ┌───────┐ ┌─────────┐ ┌──────────────────┐ │ opened ├──>│ preparing ├──>│ ready ├──>│ traffic ├──>│ traffic-complete │ └────────┘ └─────┬─────┘ └───────┘ └─────────┘ └─────────┬────────┘ │ │ │ │ │ │ │ │ │ v │ ┌────────┐ ┌─────────┐ ┌─────────┐ │ │ closed │<───────┤ cleanup │<────────┤ settled │ │ └────────┘ └─────────┘ └─────────┘ │ ^ ^ │ │ │ │ │ │ v │ │ ┌────────┐ │ │ ┌───────────┐ │ failed ├───────────────────┘ └────┤ abandoned │ └────────┘ └───────────┘ the gate cannot open the suite goes silent or gives up
┌────────┐ ┌───────────┐ ┌───────┐ ┌─────────┐ ┌──────────────────┐ │ opened ├──>│ preparing ├──>│ ready ├──>│ traffic ├──>│ traffic-complete │ └────────┘ └─────┬─────┘ └───────┘ └─────────┘ └─────────┬────────┘ │ │ │ │ │ │ │ │ │ v │ ┌────────┐ ┌─────────┐ ┌─────────┐ │ │ closed │<───────┤ cleanup │<────────┤ settled │ │ └────────┘ └─────────┘ └─────────┘ │ ^ ^ │ │ │ │ │ │ v │ │ ┌────────┐ │ │ ┌───────────┐ │ failed ├───────────────────┘ └────┤ abandoned │ └────────┘ └───────────┘ the gate cannot open the suite goes silent or gives up
┌────────┐ ┌───────────┐ ┌───────┐ ┌─────────┐ ┌──────────────────┐ │ opened ├──>│ preparing ├──>│ ready ├──>│ traffic ├──>│ traffic-complete │ └────────┘ └─────┬─────┘ └───────┘ └─────────┘ └─────────┬────────┘ │ │ │ │ │ │ │ │ │ v │ ┌────────┐ ┌─────────┐ ┌─────────┐ │ │ closed │<───────┤ cleanup │<────────┤ settled │ │ └────────┘ └─────────┘ └─────────┘ │ ^ ^ │ │ │ │ │ │ v │ │ ┌────────┐ │ │ ┌───────────┐ │ failed ├───────────────────┘ └────┤ abandoned │ └────────┘ └───────────┘ the gate cannot open the suite goes silent or gives up
┌────────┐ ┌───────────┐ ┌───────┐ ┌─────────┐ ┌──────────────────┐ │ opened ├──>│ preparing ├──>│ ready ├──>│ traffic ├──>│ traffic-complete │ └────────┘ └─────┬─────┘ └───────┘ └─────────┘ └─────────┬────────┘ │ │ │ │ │ │ │ │ │ v │ ┌────────┐ ┌─────────┐ ┌─────────┐ │ │ closed │<───────┤ cleanup │<────────┤ settled │ │ └────────┘ └─────────┘ └─────────┘ │ ^ ^ │ │ │ │ │ │ v │ │ ┌────────┐ │ │ ┌───────────┐ │ failed ├───────────────────┘ └────┤ abandoned │ └────────┘ └───────────┘ the gate cannot open the suite goes silent or gives up
┌────────┐ ┌───────────┐ ┌───────┐ ┌─────────┐ ┌──────────────────┐ │ opened ├──>│ preparing ├──>│ ready ├──>│ traffic ├──>│ traffic-complete │ └────────┘ └─────┬─────┘ └───────┘ └─────────┘ └─────────┬────────┘ │ │ │ │ │ │ │ │ │ v │ ┌────────┐ ┌─────────┐ ┌─────────┐ │ │ closed │<───────┤ cleanup │<────────┤ settled │ │ └────────┘ └─────────┘ └─────────┘ │ ^ ^ │ │ │ │ │ │ v │ │ ┌────────┐ │ │ ┌───────────┐ │ failed ├───────────────────┘ └────┤ abandoned │ └────────┘ └───────────┘ the gate cannot open the suite goes silent or gives up
┌────────┐ ┌───────────┐ ┌───────┐ ┌─────────┐ ┌──────────────────┐ │ opened ├──>│ preparing ├──>│ ready ├──>│ traffic ├──>│ traffic-complete │ └────────┘ └─────┬─────┘ └───────┘ └─────────┘ └─────────┬────────┘ │ │ │ │ │ │ │ │ │ v │ ┌────────┐ ┌─────────┐ ┌─────────┐ │ │ closed │<───────┤ cleanup │<────────┤ settled │ │ └────────┘ └─────────┘ └─────────┘ │ ^ ^ │ │ │ │ │ │ v │ │ ┌────────┐ │ │ ┌───────────┐ │ failed ├───────────────────┘ └────┤ abandoned │ └────────┘ └───────────┘ the gate cannot open the suite goes silent or gives up
┌────────┐ ┌───────────┐ ┌───────┐ ┌─────────┐ ┌──────────────────┐ │ opened ├──>│ preparing ├──>│ ready ├──>│ traffic ├──>│ traffic-complete │ └────────┘ └─────┬─────┘ └───────┘ └─────────┘ └─────────┬────────┘ │ │ │ │ │ │ │ │ │ v │ ┌────────┐ ┌─────────┐ ┌─────────┐ │ │ closed │<───────┤ cleanup │<────────┤ settled │ │ └────────┘ └─────────┘ └─────────┘ │ ^ ^ │ │ │ │ │ │ v │ │ ┌────────┐ │ │ ┌───────────┐ │ failed ├───────────────────┘ └────┤ abandoned │ └────────┘ └───────────┘ the gate cannot open the suite goes silent or gives up
| Phase | Marked by | Who acts | What happens |
|---|---|---|---|
| Open | run.opened |
the suite | opens the run for a group, naming the dispatchers it requires; every live instance of every dispatcher in the group is put on the run |
| Prepare | run.footprint-updated |
the dispatchers | the suite declares what its streams will create; each dispatcher declares what its systems will derive, and prepares; rounds run until one adds nothing |
| Traffic | the readiness gate | the suite | traffic flows at the declared rates; the suite renews its lease throughout |
| Settle | run.traffic-complete, run.settled |
the suite | the window closes; the scenario waits for downstream to drain, if it asks to |
| Judge | the suite | criteria are judged over the window: the client view and the platform view | |
| Clean up | run.cleanup-ready |
every dispatcher | each removes what its systems created and proves it; rounds run until each is complete |
| Close | closed |
the orchestrator | every instance completed (or is unreachable), on the footprint as it is now |
The readiness gate
Section titled “The readiness gate”The footprint has a version, which goes up each time something new is declared. A round reads the run, works from the footprint, and reports the version it began from. The gate is open when every instance of every required dispatcher is prepared, in a round that began from the version the footprint is at now.
Diagram: How the readiness gate converges. The suite declares 1,000 parcels, and the footprint is at version 1. The parcels and tracking dispatchers each run a round from version 1. The tracking round derives 1,000 tracking records and declares them, so the footprint grows to version 2. Both rounds report prepared on version 1, which no longer counts, and the gate stays closed. Each dispatcher checks whether anything new was reported where its hook walks; nothing was, so each settles on version 2 without running its hook again (a hook that walks the whole footprint runs a second round instead). Every instance has now prepared on the current version, and the gate opens.
1/6The suite declares. The suite declares the 1,000 parcels its stream will create. The footprint is at version 1, and the gate is closed: nobody has prepared on it yet.
2/6A round each, from v1. Each dispatcher reads the run, then walks the footprint as it was at version 1. The parcels team has nothing to add. The tracking team derives a tracking record for every parcel.
3/6The footprint grows. The tracking team declares its 1,000 records, so the footprint grows to version 2. Both rounds report prepared on version 1, which no longer counts: they never saw what grew.
4/6A look at v2. The footprint grew. Each dispatcher asks whether anything new was reported where its hook walks. The tracking team’s own records are not where either hook reads.
5/6Prepared on v2. Nothing new where they read, so both settle on version 2 without running their hooks again. A hook that walks the whole footprint runs a second round instead. A deeper cascade of teams only adds rounds.
6/6The gate opens. Every required instance has prepared on the footprint as it is now. That is a fact, not a timer, and the traffic flows.
footprint v1 · 1,000 claims suite [ declares 1,000 parcels ] parcels tracking the gate closed ─────────────────────────────────────────────────────────────────
footprint v1 · 1,000 claims suite [ declares 1,000 parcels ] parcels [ from v1: nothing to add ] tracking [ from v1: derives 1,000 ] the gate closed ─────────────────────────────────────────────────────────────────
footprint v1 · 1,000 claims v2 · 2,000 claims ^ │ suite [ declares 1,000 parcels ] │ │ │ parcels [ from v1: nothing to add ] │ prepared @ v1 │ │ tracking [ from v1: derives 1,000 ]──┘ prepared @ v1 the gate closed ───────────────────────────────────────────────────────────────── prepared on v1, but the footprint is at v2: those rounds never saw it
footprint v1 · 1,000 claims v2 · 2,000 claims ^ │ suite [ declares 1,000 parcels ] │ │ │ parcels [ from v1: nothing to add ] │ prepared @ v1 [ from v2: nothing new ] │ │ tracking [ from v1: derives 1,000 ]──┘ prepared @ v1 [ from v2: nothing new ] the gate closed ───────────────────────────────────────────────────────────────── prepared on v1, but the footprint is at v2: those rounds never saw it
footprint v1 · 1,000 claims v2 · 2,000 claims ^ │ suite [ declares 1,000 parcels ] │ │ │ parcels [ from v1: nothing to add ] │ prepared @ v1 [ from v2: nothing new ] @ v2 ✓ │ │ tracking [ from v1: derives 1,000 ]──┘ prepared @ v1 [ from v2: nothing new ] @ v2 ✓ the gate closed ───────────────────────────────────────────────────────────────── prepared on v1, but the footprint is at v2: those rounds never saw it
footprint v1 · 1,000 claims v2 · 2,000 claims ^ │ suite [ declares 1,000 parcels ] │ │ │ parcels [ from v1: nothing to add ] │ prepared @ v1 [ from v2: nothing new ] @ v2 ✓ │ │ tracking [ from v1: derives 1,000 ]──┘ prepared @ v1 [ from v2: nothing new ] @ v2 ✓ the gate closed ───────────────────────────────────────────────────────────────── open ✓ prepared on v1, but the footprint is at v2: those rounds never saw it
That is a fact, not a timer: such an instance has seen everything there is to derive from and found nothing more to add. A round that began before the footprint last grew counts for nothing, however late it reports. Every instance answers for itself, because only it knows what it prepared.
A removal is not growth. It answers for something already there, and nobody derives from it, so cleanup reports hold nobody up.
The gate fails closed. A required instance fails the run in any of these cases:
- it reports itself blocked;
- it becomes unreachable (its lease lapses, or its notifications stop arriving and it has gone silent too);
- it acknowledges the run and then goes silent;
- it does not prepare by the readiness timeout.
One run at a time
Section titled “One run at a time”A run holds every dispatcher in its group, from its opening until it closes. The orchestrator refuses any run that would overlap it: another run in the group, or a run in a group that shares one of its dispatchers. The refusal names the run that holds, and the suite waits its turn. Two load tests on the same services never share a window, so neither’s measurements carry the other’s load, and no dispatcher prepares for one run while it cleans up another.
A cleanup that outlasts the orchestrator’s cleanup hold (15 minutes by default) stops holding: it goes on, and the next run opens beside it. One that outlasts the cleanup deadline (24 hours) closes unfinished, and its journal names the instances that never completed. The run’s view says whether it holds, and its journal says when it stopped. See ADR 0015.
Failed and abandoned runs
Section titled “Failed and abandoned runs”A run that fails at its gate, or is abandoned, goes to cleanup straight away. failed and abandoned say why, and whatever was prepared is cleaned up all the same. A run is abandoned when either of these happens:
- its suite stops renewing its lease, because the runner died;
- its suite gives it up, because its scenario failed.
Silence is a signal, and the mess is still someone’s.
Rules that hold throughout
Section titled “Rules that hold throughout”- Every transition is written before it is notified. A notification never announces something that is not recorded.
- Every phase is idempotent. Notifications can arrive twice, late or out of order. They are claim checks, and a dispatcher reads the run and acts on its state.
- A declaration is a pure function of what the hook walks, and of the run. Otherwise rounds never converge.
- A bubble smoke skips all of this. A scenario that creates nothing opens no run.