dumpOnWedge
Run body, emitting a MultiNodeRaftSim.dumpState snapshot of sim to emit if body is cancelled, then rethrowing the CancellationException untouched.
This is what makes a wedge legible. When raftSimTest's RAFT_SIM_WEDGE_BACKSTOP expires, runTest cancels the test coroutine and reports a bare UncompletedCoroutinesError that says nothing about the cluster — historically the worst diagnostic in the harness. Intercepting the cancellation here puts roles, terms, commit indices, log ranges and the election histogram in the test output before that error is raised, so the next occurrence self-diagnoses.
MultiNodeRaftSim.dumpState is a suspend function that reads storage, so it cannot run on the cancelled scope — it is invoked under NonCancellable, exactly as the bounded await* helpers already do.
Only cancellation is intercepted. An ordinary failure — including the AssertionError the await* helpers throw, which already carries its own dump — propagates untouched.
raftSimTest applies this automatically; call it directly only when hand-wiring a MultiNodeRaftSim under your own runTest.
Parameters
The simulation to snapshot on a wedge.
Where the dump goes. Defaults to println, which the Gradle test report captures as system-out alongside the failure. Override to capture the dump in a test.