Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elixir-toniq/schism
Partition testing tool for elixir
https://github.com/elixir-toniq/schism
distributed-systems elixir erlang testing
Last synced: about 9 hours ago
JSON representation
Partition testing tool for elixir
- Host: GitHub
- URL: https://github.com/elixir-toniq/schism
- Owner: elixir-toniq
- License: mit
- Created: 2019-02-17T15:23:06.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-30T11:01:18.000Z (over 1 year ago)
- Last Synced: 2024-05-01T12:25:28.698Z (6 months ago)
- Topics: distributed-systems, elixir, erlang, testing
- Language: Elixir
- Homepage:
- Size: 62.5 KB
- Stars: 70
- Watchers: 5
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Schism
[![CircleCI](https://circleci.com/gh/keathley/schism.svg?style=svg)](https://circleci.com/gh/keathley/schism)[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://hexdocs.pm/schism/)
Schism provides a simple api for testing partitions between BEAM nodes.
Documentation: [https://hexdocs.pm/schism](https://hexdocs.pm/schism).
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `schism` to your list of dependencies in `mix.exs`:```elixir
def deps do
[
{:schism, "~> 1.0", only: [:dev, :test]}
]
end
```## Usage
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:```elixir
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](https://github.com/whitfin/local-cluster) and [propcheck](https://github.com/alfert/propcheck).It is not recommended that you use this in production.
## Things Schism doesn't do
Schism's reason for existing is to quickly and easily test netsplits between BEAMS
and it uses a rudimentary trick with cookies to achieve this goal. This is great
for quickly testing your system against faults.But because of Schism's simple nature it should not be considered a replacement
for a more robust suite of tests. It *does not* test failed TCP connections,
interleaving of messages, race-conditions, clock skew, corruption, or any of
the other issues you will see in a distributed system.