FaultProfile

sealed interface FaultProfile

Declarative description of which faults FaultySeam should inject.

All probabilistic profiles take an explicit seed so tests are deterministic: two runs with the same seed produce identical behaviour.

Faults are per-Direction unless otherwise noted.

Inheritors

Types

Link copied to clipboard
data class BufferCeiling(val maxOutbound: Int) : FaultProfile

Allow at most maxOutbound total outbound frames (per-link lifetime).

Link copied to clipboard
data class CloseAt(val frameIndex: Int, val reason: CloseReason = CloseReason.Normal) : FaultProfile

Close the link with reason immediately after the (frameIndex)-th outbound frame (0-based) is accepted by send.

Link copied to clipboard
data class Composite(val profiles: List<FaultProfile>) : FaultProfile

Compose multiple profiles. Applied left-to-right in profiles order: if any profile drops a frame, later profiles are not consulted for that frame. Delays accumulate.

Link copied to clipboard
data class DelayAll(val delay: Duration, val direction: Direction = Direction.Both) : FaultProfile

Delay every frame in direction by delay.

Link copied to clipboard
data class DropAll(val direction: Direction = Direction.Both) : FaultProfile

Drop every frame in direction.

Link copied to clipboard
data class DropProbabilistic(val probability: Double, val seed: Long, val direction: Direction = Direction.Both) : FaultProfile

Drop each frame independently with probability probability in direction.

Link copied to clipboard
data class DropSpecific(val frameIndexes: Set<Int>, val direction: Direction = Direction.Both) : FaultProfile

Drop only the frames whose 0-based send index appears in frameIndexes.

Link copied to clipboard
data object Healthy : FaultProfile

No faults — all frames delivered in order.

Link copied to clipboard
data class ReorderWindow(val windowSize: Int, val seed: Long, val direction: Direction = Direction.Both) : FaultProfile

Buffer up to windowSize frames then emit them in a randomised order.