ToxiproxyEx - Resiliency testing tool for Elixir

ToxiproxyEx.get!(:mysql_master)
|> ToxiproxyEx.toxic(:latency, latency: 1000)
|> ToxiproxyEx.apply!(fn ->
  Repo.all(Shop) # this took at least 1s
end)

Toxiproxy is a proxy to simulate network and system conditions. The Elixir API aims to make it simple to write tests that ensure your application behaves appropriately under harsh conditions.

Github: https://github.com/Jcambass/toxiproxy_ex
HexDocs: https://hexdocs.pm/toxiproxy_ex/

Features

Why?

ToxiproxyEx provides a simple elixir API that allows to configure and use Toxiproxy which is a is language independent tool created by Shopify and part of their resiliency toolkit.

External Services
Most applications rely on some external services such as databases or rest apis.
Testing those services is important.

While testing happy paths and error cases can be achieved with standard tools such as mock http services, testing for more nuanced situations like slow responses and hanging connections require a tool like toxiproxy to make sure that implemented resiliency strategies such as timeouts and bulkheads work as expected.

1 Like