# `mix lockstep.replay`
[🔗](https://github.com/b-erdem/lockstep/blob/v0.1.0/lib/mix/tasks/lockstep.replay.ex#L1)

Print a saved Lockstep trace as a human-readable schedule, or re-run
a specific test function under the recorded schedule.

## Print mode

    mix lockstep.replay --trace traces/foo.lockstep

Prints metadata + the formatted schedule. Includes a ready-to-paste
recipe for reproducing the bug from a fresh test run.

## Run mode

    mix lockstep.replay --trace traces/foo.lockstep \
                        --run "MyApp.RaceTest.lost_update_body" \
                        --file test/examples/foo_test.exs

Loads `--file` (so test modules become available; `mix compile`
doesn't compile test files), then calls
`Lockstep.Replay.run(&Module.function/0, trace_path)`. Run mode
raises `Lockstep.BugFound` if the bug reproduces (the expected
outcome) or `Lockstep.ReplayDivergence` if the user code is
nondeterministic.

---

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