Elixir, Telemetry, and Prometheus ThinkingElixir 087: Reviewing Elixir with José Valim - Part 2

Testing Singleton Processes with Dependency Injection

Named singleton processes are wonderful for Elixir applications, but they often make it hard to test their behavior. Since singletons are started as part of the supervision tree, they become a globally shared resource for our tests. And that can lead to intermittently failing tests due to race conditions. This is my usual approach to testing them.

https://www.germanvelasco.com/blog/testing-singleton-processes-with-dependency-injection