Three Ways Your Chaos Tests Lie to You in CI (And How to Catch Them)

· Tech

Most distributed-systems CI tests either fail for boring harness reasons, or pass while the fault never actually touched a request.

While building fuss (a zero-root L4 chaos runner with a Porcupine linearizability checker) and running it against unmodified etcd, rqlite, hraftd, and nats-server, the same three lies kept showing up. Each one fakes a green or red result, and each one can be caught automatically in the harness.

1. HTTP 200 with an error body looks like a successful write

rqlite returns HTTP 200 OK even when a Raft write fails, and puts the error in two different JSON locations:

Our first stress config only checked results.0.error. On the first 10-seed run of rqlited v10.7.4 at level=strong, a put that lost leadership mid-commit returned HTTP 200 with a top-level error and was mistakenly recorded as ok. In this run it never committed, so when the next completed get returned the real latest value (v1-29), Porcupine flagged the history as NONLINEARIZABLE. Four of the ten seeds came back NONLINEARIZABLE. On another seed, a restarting node still opening its store returned HTTP 200 with an empty results array, which the client recorded as an ok read of a missing key.

Our harness lied, not rqlite.

Diagram

The fix: Check every error path and map ambiguous Raft commit failures to indeterminate (info). In this run the write never committed, but in Raft "leadership lost while committing log" means the entry might still commit under the next leader. The client cannot know which happened, so it should be recorded as unknown:

put:
  error_from: [error, results.0.error]
  info_on_error_contains: ["leadership lost"]
get:
  error_from: [error, results.0.error]

Any present error at those paths becomes fail (like "not ready"), while a matching substring becomes info (Porcupine keeps it open-ended through the end of the history, just like transport timeouts).

rqlited v10.7.4 (level=strong) Run Result porcupine Acknowledged Ops
10 seeds (error_from: results.0.error) 6 PASS, 4 NONLINEARIZABLE passed 6/10 3,613
10 seeds (error_from: [error, results.0.error] + info) 10 PASS passed 10/10 3,650
50-seed soak (same config) 49 PASS, 1 UNAVAILABLE (seed 9) passed 50/50 18,531

On the 50-seed soak, seed 9 missed post-recovery liveness (eventually_available), while linearizability held on all 50 seeds.

2. A passing checker can mean the fault missed the traffic

A 30-second schedule can kill a process or cut a link, Porcupine can pass every seed, and CI can turn green simply because the fault landed between requests. It can also fire on a no-op (such as isolate_client when no client proxy is configured, or partition_halves on a single node), or overlap traffic only during the recovery heal_all. That heal always runs while workers are still in flight, so counting it would make every run look “covered.”

Diagram

fuss’s own repkv HTTP test hit the empty-window version of this: quiet_period was 450ms while the client timeout was 500ms. Under go test load, the recovery window recorded zero ok calls and healthy seeds came back UNAVAILABLE. Raising quiet_period to 2s (comfortably past the timeout) let in-flight workers finish and record ok calls before the liveness check ran.

The fix: Track coverage as SOMETIMES properties across -n trials: fault_during_inflight (excluding heal_all and no-ops), info_ops_observed, and fault_action_fired for named actions like isolate_node. If any declared SOMETIMES property finishes with 0 hits across -n runs, fuss prints UNMET_SOMETIMES and exits 1. Porcupine tells you the recorded history was linearizable; SOMETIMES proves the fault actually met a request.

3. A blackhole that resumes the same socket is a different network

A clean connection reset (ModeReset) hands the target an immediate EOF/ECONNRESET. Distributed systems often recover from that faster than they do from a silent drop. ModeBlackhole keeps the TCP socket open, discards payload bytes, and forces the peer to hang until its own read deadline (the sender’s Write returns because the proxy already read the chunk).

Our first Heal implementation left that open socket alive and simply resumed forwarding bytes. That creates a network that does not exist in TCP: real TCP retransmits dropped segments and never delivers byte 10,001 after silently deleting bytes 1 to 10,000 on the same stream. Resuming a blackholed socket spliced the middle out of a length-prefixed Raft/HTTP2 frame, causing the receiver to parse mid-frame garbage as the next message.

Diagram

On etcd v3.7.4 (seed 1), both etcd-serializable.yaml and etcd-linearizable.yaml came back UNKNOWN (nodes_not_ready). Node 2 exited with status 2, and target.log showed the crash:

panic: index, 54, is out of range [1] in raft.(*raftLog).maybeAppend (from handleAppendEntries)

The fix: Track whether an active connection discarded bytes while in ModeBlackhole. When Heal leaves ModeBlackhole, close every dirty connection so recovery must dial a fresh TCP stream (idle sockets that never discarded bytes stay open). TestBlackholeHealClosesDirtyConn enforces that contract.

After that fix, seed 1 ran cleanly with zero panics: etcd-serializable.yaml scored NONLINEARIZABLE (etcd’s documented stale serializable range) and etcd-linearizable.yaml scored PASS.

Try it

Full setup is in docs/quickstart.md (v0.2.2 release):

go install github.com/kriyanshii/fuss@v0.2.2

From a clone of the repo (with the example binaries built), run any scenario and inspect summary.txt and porcupine.html in the saved failure bundle:

fuss -target-config=examples/rqlite/rqlite-stress.yaml -n=10 -seed=1 -save-failed-bundle ./runs -json
fuss -target-config=examples/etcd/etcd-linearizable.yaml -n=1 -seed=1 -save-bundle ./runs -json
fuss -target-config=examples/repkv/repkv-bug.yaml -target=./examples/repkv/repkv -n=10 -seed=1 -json

Verdicts in the JSON output are computed directly from the recorded operation history.

Open interactive version