﻿---
title: Axis 06 · Temporal: Does B follow A within a deadline?
description: Axis 06, Temporal: Does B follow A within a deadline?
url: https://docs-v3-preview.elastic.dev/axes/06-temporal
---

# Axis 06 · Temporal: Does B follow A within a deadline?
## In plain words

A promise with a deadline. A confirmed order ships within a minute. The question is not whether it ships, but whether it ships in time, however the time between calls is spent.

## The bug you would ship

The service shipped 90 seconds after confirming. The promise says 60. With nobody watching a clock, the order sat "in progress" for good.

## You declare

```csharp
Temporal<FulfilmentEvent>.AfterUntil(
	e => e is FulfilmentEvent.Confirmed,
	(_, next) => next is FulfilmentEvent.Shipped,
	TimeSpan.FromSeconds(60),
	isInterrupt: e => e is FulfilmentEvent.Cancelled)  
```

Or in the fluent form: `After<Confirmed>().Then<Shipped>().Within(60s)`.

## The library does

It chooses the delays itself: none, and just before and just after the deadline, so a deadline is both met and missed within a few tries. The clock is virtual, so a 60-second deadline costs milliseconds. It fails as vacuous if no run ever went past the deadline, since then the rule could never have failed.

## When it fails, you read

Temporal failed.
Rule broken      confirmed-ships-within-a-minute
Noticed at       +60s
What happened    No matching event within 00:01:00 after Confirmed
Events recorded  +0s  Confirmed
+90s  Shipped
Calls made       wait 1s, Confirm
Law              What must follow something within a deadline does, however the time between calls is spent.
Consequence      A deadline is missed under timing the tests never tried, so a stuck state is reported as in progress for good.
Smallest case found, after 5 shrinks. To run this case again: .Seed("0i1vmP3ChLc5")
How to read this:
- **Noticed at** is when, after the first event, the deadline passed with nothing.
- **Events recorded** shows the confirmation at `+0s` and the shipment at `+90s`: too late.
- **Calls made** shows the delay the test chose before confirming.


## Why you did not write this test

You would have to pick a delay yourself, and you would pick one that works. The bug lives at the delay you did not try.

## In real code

In docs-builder, a build that overruns half an hour is a rule: otherwise the editor's panel can say "building" forever.
---

Previous: [05 Absence](https://docs-v3-preview.elastic.dev/axes/05-absence) · Next: [07 Liveness](https://docs-v3-preview.elastic.dev/axes/07-liveness) · [All nine axes](https://docs-v3-preview.elastic.dev/axes)