The Hypothesis Engine is the core of FaultLab's deterministic testing suite. It allows operators to define distributed system experiments as code.
A standard hypothesis file contains the following blocks:
name: H6_scalability_convergence
hypothesis: "Gossip convergence scales logarithmically."
description: "Tests a massive 10-node split-brain scenario."Defines the topology required for the test.
cluster:
id: h6_cluster_large
members:
- id: node1
port: 7601
- id: node2
port: 7602
...The timeline strictly dictates when actions occur during the simulation.
timeline:
- at: 0s
action: start_cluster
- at: 4s
action: partition
groups:
- [node1, node2, node3, node4, node5]
- [node6, node7, node8, node9, node10]
- at: 8s
action: write
key: scale_test
value: right_side_write
target: group2
- at: 15s
action: heal_partitionActions supported:
start_cluster: Bootstraps the nodes.partition: Splits the network into defined groups.heal_partition: Restores full network mesh connectivity.write: Injects a KV pair to a node or group.crash: Simulates a node process dying.recover: Simulates a node process restarting.
Tells the engine what to verify at the end of the timeline.
validation:
check_convergence: true
check_keys:
- scale_testIf convergence fails or takes too long, the CLI will report a failure, and the Observability UI will highlight the divergence in red.