From f645a9ba1d1b6c167fa28874d8ec63f54a7e1238 Mon Sep 17 00:00:00 2001 From: hq1 Date: Tue, 17 Sep 2024 13:34:46 +0200 Subject: [PATCH] Warm up ConCache before tests (#4587) ref: https://github.com/sasa1977/con_cache/pull/79 --- test/test_helper.exs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/test_helper.exs b/test/test_helper.exs index 28b49029a39e..c9006141c2cf 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -22,6 +22,18 @@ end default_exclude = [:slow, :minio, :migrations] +# warm up ConCache until https://github.com/sasa1977/con_cache/pull/79 +:code.ensure_loaded(ConCache.Lock.Resource) + +for i <- 1..(System.schedulers_online() * 2) do + Plausible.Cache.Adapter.with_lock( + :sessions, + {i, i + 1}, + 500, + fn -> :warmup end + ) +end + if Mix.env() == :ce_test do IO.puts("Test mode: Community Edition") ExUnit.configure(exclude: [:ee_only | default_exclude])