MultiNodeWarpSim
Multi-node warp simulation harness for use in tests. See the file-level KDoc for the full determinism contract and setup ceremony; construct via multiNodeWarpSim or — preferably — run the whole test through warpSimTest.
The harness owns the mesh (loom), one Seam and one WarpNode per peer, and the shared execution log the default tracked-echo registries record into.
Properties
The in-process mesh all seams are woven on.
Live node map — entries are removed by disconnect.
The Quilter cadence every node runs on — settle derives its pump interval from it.
A virtual clock reading the test scheduler's current time — the clock every default node runs on. Pass it to any extra WarpNode a custom nodeFactory builds so ring stamps and settle windows share the test's virtual timeline.
Functions
Close every live node and cancel its scope. Called by warpSimTest at teardown.
Remove id from the mesh: close its node, tear its seam (it disappears from every other peer's roster), and cancel its coroutines. The departed-peer scenario — surviving nodes rebuild their rings and re-home the peer's tasks.
Render a per-node diagnostic snapshot — results-board sizes, execution / failover / duplicate counters, and the tracked execution log — so a non-converging mesh names itself instead of just timing out. Used as the body of the AssertionError thrown by the bounded await helpers, and callable directly from a failing assertion.
The TaskDescriptor uses: WARP_SIM_ECHO_OP with the task id as args.
Every peer that executed taskId, in execution order (empty if none has yet).
All task ids that have been executed by at least one peer.
Record that peer executed taskId. Called by trackedEchoRegistry ops; call it from custom ops to keep executedBy / executedTaskIds (and dumpState) accurate.
Advance virtual time through rounds anti-entropy intervals, one claim settle window (when strategy has one), then rounds more intervals — the bounded, fixed-budget drain for "let the mesh converge / prove it stays quiet" phases. For waits with a concrete target, prefer awaitResults / awaitTrue: they finish as soon as the condition holds and fail fast with a dump when it never does.
An OpRegistry with one pass-through op, WARP_SIM_ECHO_OP, that records every invocation into the sim-wide execution log (executedBy / executedTaskIds) before echoing its args. The default registry for every node; call from a custom registryFactory to keep tracking while adding further ops.