Packages

Coyote-style controlled concurrency testing for the BEAM. PCT/POS scheduling, schedule shrinking, trace replay, Elixir + Erlang AST rewriters, and ETS / atomics / persistent_term sync points -- so message-passing AND shared-state races surface deterministically.

Current section

Files

Jump to
lockstep lib lockstep replay_divergence.ex
Raw

lib/lockstep/replay_divergence.ex

defmodule Lockstep.ReplayDivergence do
@moduledoc """
Raised by `Lockstep.Replay.run/2` when the replayed schedule cannot be
faithfully reproduced from the recorded trace. Almost always means the
user code under test depends on uncontrolled nondeterminism — raw RNG,
system time, ETS interleavings inside non-yielding handlers, NIFs, or
real I/O.
"""
defexception [:detail, :iteration, :seed, :trace_path]
@impl true
def message(e) do
"""
Lockstep replay diverged from the recorded trace.
iteration: #{inspect(e.iteration)}
iter seed: #{inspect(e.seed)}
trace path: #{inspect(e.trace_path)}
Detail:
#{e.detail}
"""
end
end