FaultyLoom

class FaultyLoom(delegate: Loom, scope: CoroutineScope, defaultProfile: FaultProfile = FaultProfile.Healthy) : Loom

A Loom wrapper that constructs FaultySeam instances.

A defaultProfile applies to every link the factory creates. Individual links can override their profile via FaultySeam.setFaultProfile.

Useful for fault scenarios where all links should start partitioned or delayed, then selectively healed per-peer.

scope must be a CoroutineScope that outlives the test — the standard pattern is to pass the kotlinx.coroutines.test.TestScope from runTest.

Constructors

Link copied to clipboard
constructor(delegate: Loom, scope: CoroutineScope, defaultProfile: FaultProfile = FaultProfile.Healthy)

Properties

Link copied to clipboard

All FaultySeam instances created so far, in creation order.

Functions

Link copied to clipboard

Whether this fabric can be attempted now. Default FabricAvailability.Available; fabrics gated on a runtime capability override.

Link copied to clipboard
open suspend override fun host(pattern: Pattern): FaultySeam

Host / start a new session.

Link copied to clipboard
open suspend override fun join(tag: Tag): FaultySeam

Join an existing session. The advertisement carries enough info to reach the existing peer set.

Link copied to clipboard

Apply profile to every link the factory has created so far.

Link copied to clipboard
open suspend override fun weave(rendezvous: Rendezvous): FaultySeam

Establish a Seam according to rendezvous — either host a new session or join an existing one.