pumba
AGENTS.md3.2k starsChanged 6 months agoApache-2.0View on GitHub
Integration tests use bats:
We split this AGENTS.md into the rules it gives an agent
10 rules. About 0 are common, 1 is distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 35
Bats teardown: Use sudo pkill -f "pumba.*<container-name>" to stop background pumba processes.
- Very specific: line 134
Interface name validation: call util.ValidateInterfaceName(name) for any new flag that takes a network interface name.
- Very specific: line 136
Mock constructor: Always use container.NewMockClient(t) — never new(container.MockClient).
- Very specific: line 138
Mock context: Use mock.Anything only for context.Context args.
- Very specific: line 139
Mock random container: Use mock.AnythingOfType("*container.Container") + .Once() when only one of N containers is targeted
- Very specific: line 142
Cleanup defer survives cancellation: Use context.WithoutCancel(ctx) with a timeout so defers (e.g.
- Distinctive: line 152
Run() method variants: Always add NoContainers + DryRun + WithRandom test cases
- Very specific: line 178
Before a cross-module import: archfit policy can-import <file> <target>.
- Very specific: line 179
Before you finish: archfit check --format agent.
- Very specific: line 182
Never edit .archfit.yaml, .archfit-baseline.json or .archfit-labels.yaml, and never add a waiver, to make a check pass.
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Pumba Development Guide
Build & Test Commands
- Build:
make build(builds for current TARGETOS/TARGETARCH) - Full pipeline:
make all(format → lint → test → build) - Unit tests:
make test(requiresCGO_ENABLED=1for race detector) - Test with coverage:
make test-coverage - Race detector:
make test-race(linux/amd64 only) - Lint:
make lint(runs golangci-lint with.golangci.yaml) - Format:
make fmt - Cross-compile:
make release(darwin/linux/windows × amd64/arm64) - Integration tests:
make integration-tests(requires Docker, uses bats) - All integration tests:
make integration-tests-all(includes stress tests) - Advanced Go integration tests:
make integration-tests-advanced(Go-based tests intests/integration/) - Generate mocks:
make mocks(uses mockery) - Unit tests in sandbox:
CGO_ENABLED=0 go test ./...(skips race detector, works without CGO toolchain)
Integration Testing
Integration tests use bats:
- Tests are in
tests/*.batswith helpers intests/test_helper.bash; install Bats >= 1.5.0 and thebats-support/bats-assertlibraries at/usr/local/lib/ - Result-event and schema tests (
tests/output.bats,tests/webhook.bats,tests/*status.bats,tests/schema.bats, ndjson smoke in*_global_flags.bats) needjqand userun --separate-stderrto assert on stdout alone - Webhook HTTP acceptance (
tests/webhook.bats) requirespython3(stdlib only); missing Python fails rather than skips. Theintegration-testsDocker stage includes it; the release image does not. Run fixture safety checks offline withbash tests/unit/webhook_fixtures_test.bash(no runtime needed) - Run all tests locally (recommended):
colima ssh -- sudo bats tests/*.bats tests/containerd_*.bats- Colima VM has native Docker + containerd sockets;
sudois required for containerd sidecar tests
- Colima VM has native Docker + containerd sockets;
- Docker tests only (via Docker image):
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock --entrypoint bats pumba:test tests/*.bats - Containerd tests only:
colima ssh -- sudo bats tests/containerd_*.bats - Podman tests only (macOS, inside podman machine VM):
podman machine ssh sudo bats tests/podman_*.bats - Podman tests only (Linux, rootful):
sudo bats tests/podman_*.bats - CI builds a Docker image (
pumba:testtargetintegration-tests) and runs bats inside it - Rebuild test image after code changes:
docker build --target integration-tests -t pumba:test -f docker/Dockerfile . - Copy updated binary to Colima:
colima ssh -- sudo cp /Users/alexei/workspace/pumba/.bin/linux/pumba /usr/local/bin/pumba - Bats teardown: Use
sudo pkill -f "pumba.*<container-name>"to stop background pumba processes;kill %1for job control fallback
Technical Stack
- Go version: 1.27 (see go.mod)
- CLI framework:
github.com/urfave/cli(v1) - Docker SDK:
github.com/docker/dockerv28.5.2 - Containerd SDK:
github.com/containerd/containerd/v2(containerd runtime support) - Error handling: stdlib
fmt.Errorf("...: %w", err)wrapping - Logging:
github.com/sirupsen/logrus - Testing:
github.com/stretchr/testify(assert, mock, require) - Mocking:
github.com/vektra/mockery/v3v3.7.4 - Linting: golangci-lint with
.golangci.yaml - CI: GitHub Actions (build.yaml, release.yaml, codeql-analysis.yml, nettools-images.yaml)
Project Structure
cmd/
main.go — CLI entry point: main() → run(args, stdout, stderr), signal context, app construction
events.go — --output/--run-id handling, event fan-out to bounded per-sink queues (stdout NDJSON, webhook), run.end + exit code
webhook.go — --webhook sink: URL check, one POST per event, no retries/redirects, one stderr warning
runtime.go — createRuntimeClient, tlsConfig, runtime factory vars (newDockerClient/newContainerdClient/newPodmanClient)
logging.go — setupLogging: log-level switch + Slack hook wiring
slackhook.go — Best-effort async Slack webhook logrus hook + shutdown drain
plan.go — text-mode netem/iptables dry-run renderer (would run/apply/revert); NDJSON stays event-only
status.go — text-mode `pumba status` table (TARGET KIND DETAIL RUN) + verdict line; a StatusRecorder subscribed in text mode only
flags.go — globalFlags(rootCertPath) builder (+ resultFlags: --run-id, --output, --webhook, --max-duration)
schema.go — `pumba schema` command: pumba.cli/v1 document walked from the live app
commands.go — initializeCLICommands wiring chaos cmd builders into urfave/cli commands
pkg/
chaos/
command.go — ChaosCommand interface, Runtime factory type, scheduling/interval runner
runner.go — chaos.RunOnContainers / RunOnContainersAll fanout helper (the canonical list-then-random-then-parallel/serial pattern)
target.go — per-target handle (*chaos.Target) that turns Applied/Reverted reports into target.applied/target.result events
events.go — pumba.event/v1 types, EventSink, status/error-code constants
outcome.go — Recorder (counts results before delivery), NewOutcome (run.end status + exit code), coded errors
runid.go — run ID generation and validation
status.go — status wire types (TargetState on target.result, StatusCoverage on run.end), Verdict, StatusReport + StatusRecorder hook
cmd/ — Generic NewAction[P] CLI builder shared across all chaos packages
cliflags/ — urfave/cli v1 adapter (Flags interface + V1, NewV1FromApp for app-level context) decoupling cmd builders from cli.Context; DescribeV1 is the single flag-type switch behind run.start params (`V1.CommandParams`) and `pumba schema` (`DescribeFlagsV1`/`DescribeCommandsV1`)
lifecycle/ — Runtime-agnostic lifecycle chaos actions (kill, stop, pause, rm, exec, restart); revert.go holds the batch wait-then-revert for pause/stop --restart
lifecycle/cmd/ — CLI command builders for lifecycle chaos actions
netem/ — Network emulation (combine, delay, loss, corrupt, duplicate, rate, loss_ge, loss_state)
netem/cmd/ — CLI command builders for netem
iptables/ — iptables-based packet filtering
iptables/cmd/ — CLI command builders for iptables
stress/ — stress-ng based resource stress
stress/cmd/ — CLI command builder for stress
status/ — `pumba status [--check]`: lists Pumba sidecars (label FilterFunc, excludes kind=inspect), inspects each target via InspectNetns through RunOnContainers, coverage (orphans, missing names, listing gaps via ListOpts.OnSkip) and the clean/dirty/unknown verdict
status/cmd/ — CLI command builder for status (`--run-id` here is a filter, not the invocation ID)
container/ — Container model, interfaces (Client, Lister, Lifecycle, Executor, Netem, Inspector, etc.), filtering, NetemRequest/IPTablesRequest/StressRequest/StressResult/RemoveOpts/InspectRequest value objects, FaultState, sidecar label names (labels.go)
runtime/
docker/ — Docker runtime implementation of container.Client
containerd/ — Containerd runtime implementation of container.Client
podman/ — Podman runtime implementation (embeds Docker client, overrides stress cgroup resolution + rootless guards)
netns/ — Runtime-agnostic glue shared by docker/containerd: iptables request → pkg/tc argv, InspectNetns run+parse
tc/ — tc and iptables commands Pumba runs in a target netns (netem scripts, the single iptables argv builder with the pumba:<run-id> comment) and parsers for `tc qdisc show` / `iptables -S`
util/ — Shared utilities (IP/port parsing, ValidateInterfaceName for network interface name validation)
mocks/ — Generated mock files (mockery)
tests/ — Bats integration tests
docker/ — Dockerfiles (main, alpine-nettools, debian-nettools)
deploy/ — K8s/OpenShift deployment manifests
examples/ — Demo scriptsArchitecture
Module boundaries are enforced by archfit; see docs/architecture.md for the approved module graph and how to change it.
- Container interfaces (
pkg/container/client.go): Focused sub-interfaces (Lister, Lifecycle, Executor, Netem, IPTables, Stressor, Inspector) composed into a unified Client interface. Fat methods take request value objects frompkg/container/requests.go:Netem/IPTablestake*NetemRequest/*IPTablesRequest,Stressor.StressContainertakes*StressRequestand returns*StressResult(SidecarID+Output/Errorschannels),Lifecycle.RemoveContainertakesRemoveOpts(force/links/volumes/dryRun bools),Inspector.InspectNetnstakes*InspectRequestand returns the parsed*FaultState(tagged iptables rules +504d:qdiscs) of the target's netns.CommandPlanholds exact apply/revert argv and sidecar image or direct-exec mode.Netem.PlanNetemContainerandIPTables.PlanIPTablesContainer(add, del)are pure (no I/O); planning and execution use the SAMEpkg/runtime/netnsargv builders backed bypkg/tc.SidecarSpeccarries the implementation-hint(Image, Pull)pair that runtime adapters may ignore. Netem/IPTables/Stress requests carryRunID(empty = untagged). - Artifact tagging (
pkg/container/labels.go): every sidecar Pumba creates (netem, iptables, stress, status's inspect) getscontainer.SidecarLabels(runID, targetID, kind):SkipLabel(com.gaiaadm.pumba.skip=true),RunIDLabel,TargetLabel,KindLabel(netem/iptables/stress/inspect). Use the constants; never hard-code acom.gaiaadm.pumba.*string in production code. iptables rules carry-m comment --comment pumba:<run-id>in both the add and the delete spec. qdiscs cannot be tagged;504d:ownership is classified, never attributed to a run. pkg/tcowns netns argv and parsing: the netem scripts, the single iptables argv builder (tc.IPTablesCommands, adds the comment) and thetc qdisc show/iptables -Sparsers live inpkg/tc. Docker and containerd reach them throughpkg/runtime/netns; never rebuild iptables argv or parse tc/iptables output in a runtime or inpkg/chaos.- Runtime factory injection (
pkg/chaos/command.go):chaos.Runtime func() container.Clientis a closure-based factory. Every CLI builder constructor takesruntime chaos.Runtimeexplicitly — nochaos.DockerClientglobal, no service locator.cmd/main.go::beforeconstructs the closure once after global flag parsing and propagates it throughinitializeCLICommands. - Canonical chaos fanout (
pkg/chaos/runner.go):RunOnContainers(ctx, lister, gp, limit, random, parallel, fn)is the single helper every chaos action'sRun()calls — it lists matching containers, optionally narrows to a random pick, checks the opt-ingp.MaxTargetscap before any injection, and runsfneither viaerrgroup(parallel) or sequentially (serial).RunOnContainersAllvariant lists stopped + running for lifecycle ops that target stopped containers. New chaos actions MUST use this helper instead of hand-rolling the list-then-fanout loop. - Interface name validation (
pkg/util/util.go::ValidateInterfaceName): single source of truth for theeth0/en0/lo/vlan.10regex check; bothpkg/chaos/netem/parse.goandpkg/chaos/iptables/parse.gocall it. Never re-introduce a localregexp.MustCompilefor interface names. - Generic CLI builder (
pkg/chaos/cmd/builder.go):NewAction[P]keeps chaos action cmd files in the same shape — flag list + typedParamParser[P]+CommandFactory[P]. Parsers receivecliflags.Flags, never*cli.Contextdirectly. - Shared cmd parsing (
pkg/chaos/{netem,iptables}/parse.go::ParseRequestBase): per-action cmd parsers (delay.go,loss.go, …) callParseRequestBasefirst to read parent-level flags viac.Parent()and build the populated base request (*NetemRequestfor netem; iptables returns a smallRequestBasecarrying*IPTablesRequest+ iface/protocol/limit). Per-action parsers then fill only their action-specific fields. New netem/iptables subcommands MUST follow this pattern — never re-parse the parent flag set inline. - Result events (
--output ndjson, schemapumba.event/v1, contract in docs/agents.md):run.startis emitted byNewActionafter Build;target.applied/target.resultonly byRunOnContainersthrough the*chaos.Targetit passes to eachContainerAction;run.endonly bycmd/events.gowhen the app returns.chaos.Recordercountstarget.resultsynchronously before delivery, andchaos.NewOutcomemaps counts + returned error torun.end.statusand the exit code (0/1 only). Delivering events (stdout,--webhook) happens only incmd: each sink has its own bounded queue and goroutine, counts its own drops and writes that count into itsrun.end; chaos code never does I/O for events. - CLI flags adapter (
pkg/chaos/cliflags/):Flagsinterface wrapsurfave/cliv1 viaV1. Future v3 migration is a one-file swap (v3.go+ wiring change incmd/main.go). - CLI schema (
pumba schema,pumba.cli/v1,cmd/schema.go): walks the livec.Appat run time throughcliflags.DescribeFlagsV1/DescribeCommandsV1, so new commands and flags appear without schema edits. A new urfave flag type must be added to theDescribeV1switch, elseschemafails withcliflags.ErrUnsupportedFlagType.before()incmd/main.goreturns beforecreateRuntimeClientwhen the command isschema(no socket needed). Error codes and statuses come fromchaos.ErrorCodes()/RunStatuses()/TargetStatuses(): a new code or status constant must be added there and to the pinned list inpkg/chaos/events_test.go. - Docker runtime (
pkg/runtime/docker/): Docker SDK implementation of container.Client; split per-concern acrossclient.go,http_client.go,inspect.go,lifecycle.go,exec.go,sidecar.go,netem.go,iptables.go,faultstate.go,stress.go,cgroup.go,pull.go(no monolith — every file < 350 LOC) - Containerd runtime (
pkg/runtime/containerd/): Containerd implementation of container.Client (socket:/run/containerd/containerd.sock, namespace:k8s.io); split per-concern acrossclient.go,api.go,container.go,task.go,exec.go,cgroup.go,sidecar.go,netem.go,iptables.go,faultstate.go,stress.go,stress_sidecar.go(every production file ≤ 250 LOC) - Podman runtime (
pkg/runtime/podman/): Podman implementation of container.Client; reuses the Docker SDK against Podman's Docker-compat socket and overrides only what diverges:StressContainer(cgroup resolution + rootless guard) and rootless guards onNetemContainer/StopNetemContainer/IPTablesContainer/StopIPTablesContainer/PlanNetemContainer/PlanIPTablesContainer/InspectNetns. Whencontainer.Clientgrows a method that needs the target netns or a cgroup, add the override and update the list inclient.goanddoc.go. Socket auto-detected from$CONTAINER_HOST,$PODMAN_SOCK,podman machine inspect,/run/podman/podman.sock, and$XDG_RUNTIME_DIR/podman/podman.sock; override via--podman-socket. Cgroup parent/leaf derived host-side from/proc/<pid>/cgroupof the target container (seepkg/runtime/podman/cgroup.go) — pumba must run on the same kernel as the targets. - Chaos commands: Each action implements
ChaosCommandinterface withRun(ctx, random)method - Network emulation / iptables filtering: Both paths (
NetemContainer,IPTablesContainer) execute commands inside an ephemeral sidecar container that joins the target's network namespace. The shared lifecycle — create, start, exec-per-args (with exit-code check), force-remove — lives inrunSidecar/runSidecarExec(pkg/runtime/docker/sidecar.go). Neithernetem.gonoriptables.gomanage sidecar lifecycle directly. - Stress testing: Two modes — (1) default child-cgroup mode places stress-ng sidecar in target's cgroup via Docker's
--cgroup-parent; (2) inject-cgroup mode (--inject-cgroup) uses thecg-injectbinary (shipped inghcr.io/alexei-led/stress-ng) to write sidecar PID into target'scgroup.procsfor shared resource accounting - Target selection: Container names (exact), comma-separated lists, or
re2:prefixed regex patterns - Label filtering:
--label key=valueflags for container selection - Interval mode:
--intervalflag for recurring chaos on a schedule
Code Conventions
- Error wrapping:
fmt.Errorf("...: %w", err); do not addgithub.com/pkg/errors - Interfaces: Define interfaces for testability (Client in
pkg/container/client.go) - Constructor injection over globals: Chaos cmd builders take
runtime chaos.Runtimeand produce a closure that reads it lazily. Never reintroduce achaos.DockerClient-style global — visibility in the function signature is the rule. - Request value objects for fat methods: Interface methods accept request structs from
pkg/container/requests.go, not long positional arg lists. Examples:Netem.NetemContainer(*NetemRequest),IPTables.IPTablesContainer(*IPTablesRequest),Stressor.StressContainer(*StressRequest) (*StressResult, error),Lifecycle.RemoveContainer(*Container, RemoveOpts). New runtime methods that exceed 4 params must follow the same pattern. Pass pointer for ≥3-field requests; pass-by-value for tiny opts (likeRemoveOpts's 4 bools). - Chaos fanout via
chaos.RunOnContainers: New chaos actions MUST route throughchaos.RunOnContainers(orRunOnContainersAllfor stopped-container targeting) — never hand-rollcontainer.ListNContainers+ manualsync.WaitGroup/errgroupfanout in aRun()body. The helper enforces list → limit/random narrowing → target-cap check → parallel-or-serial → collect-errors uniformly. Keep and pass the*GlobalParamsyou received — never copy it (it carries the run ID, event sink, tick counter andMaxTargets;go vetcopylocks flags copies) — and wrap errors with%wsoErrMaxTargetsExceededcannot be suppressed by--skip-error. Action-specific timeouts (e.g.context.WithTimeout(ctx, n.req.Duration)) belong inside the closure, not at the caller. ContainerActioncontract:func(ctx, c, t *chaos.Target) error. Callt.Applied()right after inject (one-shot actions: after the call succeeded) andt.Reverted(err)with the revert outcome; the runner emits the terminaltarget.resultwhen the action returns. Batch reverts (pause, stop--restart) callt.DeferResult()and invoke the returned func after that target's own revert (seelifecycle/revert.go). Dry-run must return without waiting for--duration. Netem/iptables dry-runs call only the pure plan method (not inject/revert), attach it witht.SetPlan, and emit plannedtarget.resultwith notarget.applied. A cleanup failure after a successful inject must be returned as an error (exit 1), not only logged.- Interface name validation: call
util.ValidateInterfaceName(name)for any new flag that takes a network interface name. Do not introduce a localregexp.MustCompilefor theeth0/en0/vlan.10pattern. - Mocking: testify mocks, generated by mockery v3. Mock files live in
mocks/,pkg/container/mock_*.go, and test-onlypkg/runtime/containerd/mock_*_test.go. Never generate external SDK mocks into production.gofiles. - Mock constructor: Always use
container.NewMockClient(t)— nevernew(container.MockClient); auto-asserts expectations on test cleanup - Mock request structs: EXPECT() calls for
NetemContainer/IPTablesContainer/StressContainer/InspectNetnspass the corresponding*NetemRequest/*IPTablesRequest/*StressRequest/*InspectRequestliteral (ormock.AnythingOfType("*container.NetemRequest")etc.);RemoveContainertakes aRemoveOpts{...}literal (value, not pointer). Never the old positional form. - Mock context: Use
mock.Anythingonly forcontext.Contextargs; use exact values for all business params - Mock random container: Use
mock.AnythingOfType("*container.Container")+.Once()when only one of N containers is targeted - Logging: logrus with structured fields. Log level set via
--log-levelflag - Constants: Magic numbers use
mndlinter — use named constants - Cleanup defer survives cancellation: Use
context.WithoutCancel(ctx)with a timeout so defers (e.g. sidecar cleanup) run even when the caller cancels - gocyclo violations (limit: 15): Extract loop bodies or complex branches into named helper methods
- funlen violations (limit: 105): Extract initialization blocks (flags, config setup) into named helper functions
- Default branch:
master - NEVER add AI co-author to git commits
Unit Test Coverage Strategy
- Skip from unit tests (covered by integration tests or untestable without real runtime):
cmd/main.goand the rest ofcmd/*.goexceptcmd/main_test.go(which exercises thecreateRuntimeClientseam incmd/runtime.go),cmd/events_test.go(NDJSON stream, run.end per outcome, stalled-writer drops, usage errors),cmd/plan_test.go(text and NDJSON dry-run plans),cmd/schema_test.go(schema document, no runtime),cmd/webhook_test.go(httptest receiver: body/order, failures as drops, warning without URL, bounded flush) andcmd/slackhook_test.go(webhook payload, thresholds, failure handling, and shutdown drain),mocks/,NewClient/Close,sidecar.go(real container API for create/start/exec/remove),*/cmd/flag builders - Run() method variants: Always add NoContainers + DryRun + WithRandom test cases
- Run unit tests in sandbox:
CGO_ENABLED=0 go test ./...(no CGO needed outside CI)
Gotchas
- PID 1 signal handling:
sleep/tail -f /dev/nullas container PID 1 ignores SIGTERM — usetopin bats tests that kill with SIGTERM - iptables flag ordering:
--source,--destination,--src-port,--dst-portare on theiptablesparent command, NOT on thelosssubcommand - exec command parsing:
--command "touch /tmp/foo"is wrong (treated as binary name with spaces); use--command "touch" --args "/tmp/foo" - Containerd sidecar requires root: netem/iptables tests on containerd need
sudo pumba— overlayfs mounts for sidecar creation require root in Colima VM - Containerd namespaces: Docker-managed containers live in
mobynamespace; pure containerd indefault; Kubernetes ink8s.io - Podman requires rootful for netem/iptables/stress: rootless Podman is detected at
NewClienttime fromInfo.SecurityOptionsand every netem/iptables/stress call fails fast with a message pointing atpodman machine set --rootful(macOS) or the rootful systemd unit (Linux). Rootless support is out of scope — would need slirp4netns/pasta netns handling and user-namespace cgroup math. - Podman cgroup leaf naming: Podman uses
libpod-<id>.scope(orlibpod-<id>.scope/containerwith init sub-cgroup) under systemd, vs Docker'sdocker-<id>.scope. Pointing--runtime dockerat Podman's compat socket silently places stress-ng sidecars in the wrong cgroup;--runtime podmanderives the correct path. - Podman cgroup resolution reads host-side
/proc/<pid>/cgroup: containers launched under Podman's default--cgroupns=privatesee only0::/or0::/containerfrom inside the container, so we read from pumba's own view of/proc(requires shared kernel with targets). On macOS this means running pumba inside thepodman machineVM — the same pattern used for containerd testing in Colima. Seepkg/runtime/podman/cgroup.goand thecgroupReadervar for the test-injectable hook. ContainerExecStartempty options breaks on Podman: Docker'sContainerExecStart(ctx, id, ExecStartOptions{})with no attach/detach flags is accepted by Docker (implicit sync via HTTP hijack) but rejected by Podman's compat API with "must provide at least one stream to attach to". TherunExechelper inpkg/runtime/docker/exec.gogoes throughContainerExecAttach+ drain + inspect — works on both. When writing new exec-driven code, never callContainerExecStartwith empty options; use the helper.- tc/iptables sidecar cleanup must survive ctx cancel:
runSidecar(inpkg/runtime/docker/sidecar.go) callsremoveSidecar(wrapsContainerRemovewithcontext.WithoutCancel(ctx)+ 15 s timeout). Without this, SIGTERM to pumba during the narrow window after tc exec and before sidecar reap leaks the sidecar AND leaves the netem qdisc on the target's netns. - Sidecar
StopSignal: "SIGKILL":tail -f /dev/nullas PID 1 ignores SIGTERM. Podman'sDELETE ?force=1sends SIGTERM and waits the fullStopTimeout(10 s) before escalating — that's 10 s per sidecar reap on every netem/iptables call. Config setsStopSignal: "SIGKILL"so force-remove is immediate. - Podman inject-cgroup needs SYS_ADMIN +
label=disable+ nested leaf: cg-inject writes the sidecar's PID into the target'scgroup.procs. Three gotchas stack on cgroup v2 + systemd: (1) the target's scope may have a nestedcontainer/leaf (Podman's libpod init sub-cgroup) — cgroup v2's "no internal processes" rule means we must targetlibpod-<id>.scope/container/cgroup.procs, not the outer scope.pkg/runtime/podman/stress.go::resolveCgroupreads/proc/<pid>/cgroupplusos.Statto pick between them. (2) Writing across sibling scopes requiresCAP_SYS_ADMINin the initial user namespace. (3) SELinuxcontainer_tblocks cgroup writes even with SYS_ADMIN;SecurityOpt: ["label=disable"]on the sidecar bypasses this. All three are required on Fedora CoreOS / RHEL hosts. - Podman 4.9.x transient
/containersub-cgroup races inject-cgroup: Stock Podman 4.9.x on Ubuntu 24.04 creates<scope>/containerduring libpod init, migrates PID 1 to<scope>shortly after, andrmdirs/containermid-flight. The resolver'sos.Statcheck can pass and then/containeris gone by the time cg-inject opens/writescgroup.procs, yielding ENOENT on write (documented Podman behavior — see podman#20910). Podman 5.x (podman machine, Fedora CoreOS) keeps/containerstable. The inject-cgroup bats test lives intests/skip_ci/podman_stress_inject_cgroup.batsand is excluded from the GH CI globtests/podman_*.batsfor this reason. Proper fix: retry-on-ENOENT inside cg-inject (stress-ng sibling repo), then move the test back. - Containerd sidecar and exec IDs are random across processes:
pumba-sidecar-<random>/pumba-stress-<random>and their<id>-snapshotkeys do not reuse a per-process counter. Crashed runs can still leave artifacts; Bats teardowns must remove leftovers by label (ctr c ls 'labels."com.gaiaadm.pumba.run-id"~=^<prefix>'), thent rm -f,c rm,snapshots rm. - Kill a backgrounded
sudo pumbaby its own cmdline:$!is thesudoPID, andkill -9on it leaves pumba running. Usesudo pkill -9 -f '^pumba .*--run-id <id>'(the^anchor keeps pkill off the sudo/shell wrappers whose cmdlines also contain the pattern). - Ephemeral tc sidecar breaks poll-based bats assertions: the tc sidecar lives only for the duration of tc exec (sub-second) before
removeSidecarreaps it. Bats tests thatpodman ps-polled for the sidecar (to verify the skip label) race the lifecycle. Rewrotetests/podman_sidecar.batstests 68/69 to assert invariants instead: (a) create a fake container with the skip label manually and confirm pumba's re2: regex doesn't target it; (b) verify netem rules are removed from the TARGET netns after SIGTERM (viansenter), not whether the sidecar itself was tracked.
<!-- archfit:start --><!-- Generated by `archfit agents-md` from .archfit.yaml. Edit the config, not this block. -->Architecture guardrails (archfit)
- Before a cross-module import:
archfit policy can-import <file> <target>.deniednames the rule and what to do instead;unconstrainedis not permission. - Before you finish:
archfit check --format agent. Follownext_action;change.status: passis a correct finish, even with exit code 2. - Module owner, layer, allowlists and rules for a path:
archfit policy where <path>. - At session start, or when unsure the hooks run:
archfit doctor. - Never edit
.archfit.yaml,.archfit-baseline.jsonor.archfit-labels.yaml, and never add a waiver, to make a check pass. restore_evidence: do what the result names (install the analyzer, merge or rebase the target), then run again.ask_owner, or anunknownyou cannot clear: stop, report the rule and what you need, and ask the architecture owner.
<!-- archfit:end -->Trending
More talk lately.about the whole repository
Who's talking about alexei-led/pumba
- Stack Overflow“Is it possible to simulate connection timeout using wiremock tools?”Stack Overflow · Feb 12, 2020 · 10 votes
- @vepo.dev“Que coisa linda isso aqui!! Perfeito pra quem estuda otimização de sistemas distribuídos!!! 😍 …”Bluesky · Oct 3, 2024 · 8 likes
- VictoriaMetrics/VictoriaMetrics“Introduce chaos testing”GitHub · Oct 22, 2025 · 4 reactions
- Stack Overflow“How to simulate network drops for each individual Docker container at will?”Stack Overflow · Apr 19, 2020 · 4 votes
- Homebrew/homebrew-core“pumba 1.4.0”GitHub · Oct 29, 2026
The biggest 5 of 54 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 54
Talked about on GitHub, Stack Overflow and Bluesky (54 times).
On GitHub · 50
- Oct 22, 2025Introduce chaos testing — VictoriaMetrics/VictoriaMetricssays it tested it4 reactions · 2 comments
- Oct 29, 2026pumba 1.4.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Oct 29, 2026pumba 1.3.1 — Homebrew/homebrew-core0 reactions · 1 comment
- Oct 29, 2026pumba 1.3.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Oct 26, 2026[WJ-485] Pumba — Rokurolize/wikijump0 reactions
45 more on GitHub
- Oct 1, 2026[task] ExecContainer fails when executing a command with arguments in a container (non-… — l8o90oybae/alexei-led__pumba.362dc38d0 reactions
- Oct 1, 2026[task] Stress command stops the target container instead of the stress sidecar and igno… — l8o90oybae/alexei-led__pumba.362dc38d0 reactions
- Sep 22, 2026Candidate entries for review — hexsecs/awesome-embedded-security0 reactions · 1 comment
- Aug 27, 2026M2: MCP server exposing chaos tools — mikelord007/Chaos_Notary0 reactions · 4 comments
- Aug 23, 2026pumba 1.2.1 — Homebrew/homebrew-core0 reactions · 1 comment
- Jun 6, 2026E2E test + benchmark harness across container topologies (manual, not CI-gated) — FreeTAKTeam/LXMF-rssays it tested it0 reactions
- May 5, 2026pumba 1.1.7 — Homebrew/homebrew-core0 reactions · 1 comment
- May 1, 2026pumba 1.1.6 — Homebrew/homebrew-core0 reactions · 1 comment
- Apr 30, 2026pumba 1.1.4 — Homebrew/homebrew-core0 reactions · 1 comment
- Apr 29, 2026AUR Bump: pumba — aminvakil/nvchecker0 reactions · 1 comment
- Apr 28, 2026pumba 1.1.3 — Homebrew/homebrew-core0 reactions · 1 comment
- Apr 26, 2026pumba 1.1.2 — Homebrew/homebrew-core0 reactions · 1 comment
- Apr 26, 2026AUR Bump: pumba — aminvakil/nvchecker0 reactions
- Apr 24, 2026pumba 1.1.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Mar 14, 2026pumba 1.0.6 — Homebrew/homebrew-core0 reactions · 1 comment
- Mar 14, 2026AUR Bump — aminvakil/nvchecker0 reactions
- Mar 13, 2026pumba 1.0.5 — Homebrew/homebrew-core0 reactions · 1 comment
- Mar 2, 2026AUR Bump — aminvakil/nvchecker0 reactions
- Mar 1, 2026pumba 1.0.4 — Homebrew/homebrew-core0 reactions · 1 comment
- Feb 28, 2026AUR Bump — aminvakil/nvchecker0 reactions
- Feb 27, 2026pumba 1.0.3 — Homebrew/homebrew-core0 reactions · 1 comment
- Feb 27, 2026pumba 1.0.2 — Homebrew/homebrew-core0 reactions · 1 comment
- Feb 26, 2026AUR Bump — aminvakil/nvchecker0 reactions
- Feb 25, 2026pumba 1.0.1 — Homebrew/homebrew-core0 reactions · 1 comment
- Feb 25, 2026pumba 1.0.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Feb 18, 2026pumba 0.12.3 — Homebrew/homebrew-core0 reactions · 1 comment
- Feb 17, 2026pumba 0.12.2 — Homebrew/homebrew-core0 reactions · 1 comment
- Feb 17, 2026pumba 0.12.1 — Homebrew/homebrew-core0 reactions · 1 comment
- Feb 16, 2026pumba 0.11.10 — Homebrew/homebrew-core0 reactions · 1 comment
- Feb 15, 2026AUR Bump — aminvakil/nvchecker0 reactions
- Mar 17, 2025pumba 0.11.6 — Homebrew/homebrew-core0 reactions · 1 comment
- Mar 17, 2025AUR Bump — aminvakil/nvchecker0 reactions
- Mar 16, 2025pumba 0.11.3 — Homebrew/homebrew-core0 reactions · 1 comment
- Mar 16, 2025AUR Bump — aminvakil/nvchecker0 reactions
- Mar 16, 2025pumba 0.11.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Oct 24, 2024Integrate network chaos testing for proxy — neondatabase/neonsays it tested it0 reactions · 1 comment
- Aug 24, 2024Introduce Pumba for local chaos testing — marcus-sa/deepkit-ftgo-appsays it tested it0 reactions
- Sep 7, 2023AUR Bump — aminvakil/nvchecker0 reactions
- Jan 10, 2023AUR Bump — aminvakil/nvchecker0 reactions
- May 17, 2022fixed cgroup issue because cgroup tree has changed, which integrated … — alexei-led/stress-ng0 reactions · 1 comment
- Mar 3, 2022Axon hangs after period of slow DB responses — AxonIQ/AxonFramework0 reactions · 9 comments
- Aug 18, 2021pod-network-latency fail cause socket is not given to test container + security issue — litmuschaos/litmus0 reactions · 2 comments
- Jun 10, 2021add examples on how to use `pumba netem` for link impairments — srl-labs/containerlab0 reactions · 6 comments
- May 20, 2021Python infra: add ability to spawn containers — microsoft/CCF0 reactions · 4 comments
- Dec 17, 2020pumba: fix sha256 mismatch — Homebrew/homebrew-core0 reactions · 3 comments
On Stack Overflow · 3
- Feb 12, 2020Is it possible to simulate connection timeout using wiremock tools?10 votes
- Apr 19, 2020How to simulate network drops for each individual Docker container at will?4 votes
- Oct 28, 2019Chaos testing of Vertx Applicationsays it tested it0 votes
On Bluesky · 1
- Oct 3, 2024Que coisa linda isso aqui!! Perfeito pra quem estuda otimização de sistemas distribuídos!!! 😍 github.com/alexei-led/p... — @vepo.dev8 likes and reposts
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- docs/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

