Skip to main content

protocol/testing/toxics

packages/protocol/src/testing/toxics

Purpose

Public barrel for Toxiproxy toxic profiles and control helpers.

Public surface

allToxicTags

Variable
All six toxic tags, enumerated for coverage assertions in Tier D.

defaultToxicProfile

Variable

makeToxiproxyClient

Function

ToxicControlError

Class
Toxiproxy HTTP API returned a non-2xx, or the control endpoint is down.

ToxicHandle

Interface
A live toxic attachment. Scoped: acquiring adds the toxic to the proxy, releasing the scope removes it. Tier D properties acquire a ToxicHandle inside Effect.scoped so a crashed property still cleans up.

ToxicProfile

TypeAlias
Toxic profile DSL. Per D2 and Invariant I4, adversity is a parameter selected at suite invocation, not hardcoded case-by-case. A ToxicProfile is a named preset (one of the six toxics) plus its parameters; the Tier D runner picks the matching Tier C invariant and re-runs it with the toxic attached. Exhaustiveness: the _tag union covers every toxic named in §5 Tier D (D1–D6) so the implementer cannot forget a branch in the client dispatch.

ToxicTag

TypeAlias

ToxiproxyClient

Interface

ToxiproxyConfig

Interface

ToxiproxyNetworkConfig

Interface

ToxiproxyProxy

Interface
A live proxy that sits between TestClient and the real server (or between real client and TestServer). Acquiring the scope allocates an ephemeral port and registers the proxy; releasing deletes it.

Files

  • client.ts
  • defaults.ts
  • errors.ts
  • profile.ts