chaostest

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package chaostest provides testing.TB integration helpers for chaotic. The most-used function is New, which returns a fresh engine bound to the test's t.Cleanup so faults from one test never leak into another.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEventsExhausted

func AssertEventsExhausted(t testing.TB, eng *engine.Engine)

AssertEventsExhausted fails t if any named rule on eng has not fired at least once. Useful for asserting "every chaos rule I configured was actually exercised by my test".

func AssertHits

func AssertHits(t testing.TB, eng *engine.Engine, ruleName string, want int)

AssertHits fails t with a clear message if eng has not fired ruleName exactly want times.

func New

func New(t testing.TB, opts ...engine.Option) *engine.Engine

New returns an engine that resets itself when t finishes. Safe for t.Parallel because every test gets its own engine.

Types

This section is empty.

Directories

Path Synopsis
Package quick provides opinionated one-line shortcuts for the most common chaos test setups.
Package quick provides opinionated one-line shortcuts for the most common chaos test setups.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL