Package-level declarations

Types

Link copied to clipboard
class ControllableLoom(val policy: DeliveryPolicy = DeliveryPolicy.Reliable) : Loom

A drop-in replacement for us.tractat.kuilt.core.InMemoryLoom with controllable per-peer delivery for deterministic concurrency testing.

Link copied to clipboard

A Seam produced by ControllableLoom. Delivery is controlled by the parent loom; callers interact with it identically to any other Seam.

Link copied to clipboard

Which direction a fault applies to.

Link copied to clipboard
class FakeLoom : Loom

A test double for Loom that returns FakeSeam instances.

Link copied to clipboard
class FakeSeam(val selfId: PeerId = PeerId("self"), initialPeers: Set<PeerId> = setOf(selfId), initialState: SeamState = SeamState.Woven, policy: DeliveryPolicy = DeliveryPolicy.Reliable) : Seam

A test double for Seam with test-driver helpers for state mutation, frame delivery, and outgoing-frame inspection.

Link copied to clipboard
sealed interface FaultProfile

Declarative description of which faults FaultySeam should inject.

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

A Loom wrapper that constructs FaultySeam instances.

Link copied to clipboard
class FaultySeam(delegate: Seam, scope: CoroutineScope, initialProfile: FaultProfile = FaultProfile.Healthy, policy: DeliveryPolicy = DeliveryPolicy.Reliable) : Seam

A Seam wrapper that injects configurable faults for use in tests.

Link copied to clipboard
class FlakyLifecycleLoom(delegate: Loom, scope: CoroutineScope) : Loom

A Loom wrapper that produces FlakyLifecycleSeam instances.

Link copied to clipboard
class FlakyLifecycleSeam(delegate: Seam, scope: CoroutineScope) : Seam

A Seam wrapper that owns its own state and gates the contract on it, enabling lifecycle-flap scenarios in tests.

Link copied to clipboard
data class FlapSchedule(val seed: Long, val meanUptime: Duration, val meanDowntime: Duration, val giveUpAfter: Int)

Declarative soak driver for FlakyLifecycleSeam.drive.

Properties

Link copied to clipboard

Wall-clock backstop for a runTest whose trajectory runs on virtual time — the budget for a genuine wedge, not a performance assertion.

Functions

Link copied to clipboard
inline suspend fun <E : Throwable> TestScope.assertAbortsOnMidHandshakeCollapse(seam: FakeSeam, drainedPeer: PeerId, timeout: Duration = 5.seconds, crossinline establish: suspend () -> Unit)

Consumer-level invariant: an establishment await over a controllable seam must abort (throw within a bound) when membership drains mid-handshake — it must never suspend forever.

Link copied to clipboard
fun assertAll(vararg assertions: () -> Unit)

Runs every assertion, collecting every failure instead of stopping at the first, then reports all of them together.

Link copied to clipboard
fun TestScope.drainAntiEntropy(interval: Duration, rounds: Int, settleWindow: Duration = Duration.ZERO, postSettleRounds: Int = 0)

Advances virtual time in bounded steps to let a never-quiescing background system (e.g. Quilter anti-entropy) converge — the safe replacement for kotlinx.coroutines.test.TestCoroutineScheduler.advanceUntilIdle, which would spin forever on a re-arming timer (see the file KDoc).

Link copied to clipboard
fun TestScope.drainAntiEntropyUntil(interval: Duration, maxRounds: Int, describe: () -> String = { "condition never satisfied" }, predicate: () -> Boolean)

Bounded virtual-time drain that stops as soon as predicate holds — the early-exit companion to drainAntiEntropy.

Link copied to clipboard

Build a wired group of FakeSeams, one per id in peerIds, whose FakeSeam.broadcast calls cross-deliver into every other seam's Seam.incoming — the N-peer generalisation of fakeSeamPair.

Link copied to clipboard
fun fakeSeamPair(hostId: PeerId, joinerId: PeerId): Pair<FakeSeam, FakeSeam>

Build a wired pair of FakeSeams whose FakeSeam.broadcast calls cross-deliver into the other seam's Seam.incoming, matching the send semantics of a real two-peer fabric.