Schism v1.0.1 Schism View Source
Schism allows you to create network partitions in erlang nodes without needing to leave elixir.
Let's say that we have 5 nodes and we want to test what happens when they disconnect from each other. We can use Schism like so:
test "netsplits" do
[n1, n2, n3, n4, n5] = nodes
# Partition our nodes
Schism.partition([n1, n3])
Schism.partition([n4])
Schism.partition([n2, n5])
# Test some stuff...
# Heal our partitions
Schism.heal([n1, n3])
Schism.heal([n2, n4, n5])
end
This api is useful for testing and development in conjunction with tools like local cluster and propcheck.
Link to this section Summary
Functions
Re-connects the nodes to the cluster
Creates a partition amongst a set of nodes. Any nodes in the partition will be able to see each other but no other nodes in the network. The partitioned nodes will still be able to see the node that induced the partition. Otherwise we would not be able to heal the partition
Link to this section Functions
heal(nodes) View Source
Re-connects the nodes to the cluster.
partition(nodes, id \\ random_string()) View Source
Creates a partition amongst a set of nodes. Any nodes in the partition will be able to see each other but no other nodes in the network. The partitioned nodes will still be able to see the node that induced the partition. Otherwise we would not be able to heal the partition.