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
This commit is contained in:
Haelwenn 2022-08-12 01:36:11 +00:00
commit 837d4dc87f

View file

@ -112,7 +112,17 @@ def start(_type, _args) do
# See http://elixir-lang.org/docs/stable/elixir/Supervisor.html # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
# for other strategies and supported options # 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) result = Supervisor.start_link(children, opts)
set_postgres_server_version() set_postgres_server_version()