summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2022-08-12 01:36:11 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2022-08-12 01:36:11 +0000
commit837d4dc87f502c044414e4155c5401c13008047e (patch)
tree83218ae829e87293bca300779f075a55cc3716a0
parent93f12c0d0df445cf85f36a34c6a542cd2fa4d96a (diff)
parent28626eafc174e6707ab4020f72a5550446730da9 (diff)
Merge branch 'fix_flaky_tests_where_we_sometimes_loose_db_connections' into 'develop'
Fix flaky tests with DB connections; Allow higher amount of restarts for Pleroma.Repo during testing See merge request pleroma/pleroma!3696
-rw-r--r--lib/pleroma/application.ex12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex
index d808bc732..ae3ef9738 100644
--- a/lib/pleroma/application.ex
+++ b/lib/pleroma/application.ex
@@ -112,7 +112,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()