# `LatticeStripe.Testing.TestClock.Owner`
[🔗](https://github.com/szTheory/lattice_stripe/blob/v2.2.2/lib/lattice_stripe/testing/test_clock/owner.ex#L1)

GenServer-backed registry that owns per-test `LatticeStripe.Testing.TestClock`
ids so integration tests can isolate time-travel state.

The Owner tracks clock ids created during a single test and deletes them on
`cleanup/2` (invoked from an `on_exit` callback), mirroring the pattern used
by `Ecto.Adapters.SQL.Sandbox.start_owner!/2`. The Owner is intentionally
NOT `start_supervised!` — it must outlive the test pid so `on_exit` can still
delete clocks even when the test crashes or raises.

## Usage

The Owner is started automatically by `LatticeStripe.Testing.TestClock.test_clock/1`
and should not be called directly by application code.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `cleanup`

```elixir
@spec cleanup(pid(), LatticeStripe.Client.t()) :: :ok
```

Best-effort delete of every registered clock, then stops the owner.

Errors from individual `delete/3` calls are swallowed — the Mix task is
the backstop. Called from an `on_exit` callback after the test exits.

# `register`

```elixir
@spec register(pid(), String.t()) :: :ok
```

# `registered`

```elixir
@spec registered(pid()) :: [String.t()]
```

# `start_owner!`

```elixir
@spec start_owner!(keyword()) :: pid()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
