From a2f2df709c13354750bd8485c4026ff01596162a Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Wed, 13 Jul 2022 15:54:43 +0100 Subject: [PATCH] max restarts in test to 100 --- lib/pleroma/application.ex | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex index fcb1d6571..5801e930d 100644 --- a/lib/pleroma/application.ex +++ b/lib/pleroma/application.ex @@ -82,7 +82,17 @@ defmodule Pleroma.Application do # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html # for other strategies and supported options - opts = [strategy: :one_for_one, name: Pleroma.Supervisor] + # If we have a lot of caches, default max_restarts can cause test + # resets to fail. + # Go for the default 3 unless we're in test + max_restarts = + if @mix_env == :test do + 100 + else + 3 + end + + opts = [strategy: :one_for_one, name: Pleroma.Supervisor, max_restarts: max_restarts] result = Supervisor.start_link(children, opts) set_postgres_server_version()