warpSimTest

fun warpSimTest(n: Int = 3, quilterConfig: QuilterConfig = MULTI_NODE_WARP_SIM_QUILTER_CONFIG, heartbeatConfig: HeartbeatConfig = HeartbeatConfig(), strategy: ClaimStrategy = ClaimStrategy.RingWithIntent(), registryFactory: (MultiNodeWarpSim, PeerId) -> OpRegistry = { sim, id -> sim.trackedEchoRegistry(id) }, nodeFactory: (MultiNodeWarpSim, PeerId, Seam, CoroutineScope) -> WarpNode? = null, timeout: Duration = WARP_SIM_WEDGE_BACKSTOP, body: suspend TestScope.(MultiNodeWarpSim) -> Unit): TestResult

Build a MultiNodeWarpSim of n peers and run body under runTest(StandardTestDispatcher(), timeout = WARP_SIM_WEDGE_BACKSTOP) — the canonical harness for multi-node coordination-free warp tests. Closes every node after body. See MultiNodeWarpSim for the full determinism contract.

@Test
fun tasksConverge() = warpSimTest(n = 3) { sim ->
val tasks = (1..6).map { TaskId("t$it") }
tasks.forEach { sim.enqueueEcho(it) }
sim.awaitResults(tasks)
}

Parameters

n

Number of peers (default 3).

quilterConfig

Anti-entropy cadence, forwarded to multiNodeWarpSim.

heartbeatConfig

Heartbeat timing, forwarded to multiNodeWarpSim.

strategy

Claim strategy, forwarded to multiNodeWarpSim.

registryFactory

Per-node registry builder, forwarded to multiNodeWarpSim.

nodeFactory

Custom node builder, forwarded to multiNodeWarpSim.

timeout

Wall-clock wedge backstop, not a performance budget — read WARP_SIM_WEDGE_BACKSTOP before changing it, and in particular before tightening it. Fast failure is the job of the bounded await* helpers' virtual within bounds, which are load-independent and dump state.