From 41c88c4fa03fb8461626f1865f1c549d48d718cf Mon Sep 17 00:00:00 2001 From: Vini Brasil Date: Mon, 19 Jun 2023 11:05:00 +0100 Subject: [PATCH] Add unique names to cache supervisors in tests (#3055) This commit fixes a flaky test where a supervisor with that same name was already started. --- test/plausible/site/cache_test.exs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/plausible/site/cache_test.exs b/test/plausible/site/cache_test.exs index b6733892e..99205b12e 100644 --- a/test/plausible/site/cache_test.exs +++ b/test/plausible/site/cache_test.exs @@ -30,7 +30,7 @@ defmodule Plausible.Site.CacheTest do {:ok, _} = Supervisor.start_link([{Cache, [cache_name: test, child_id: :test_cache_caches_id]}], strategy: :one_for_one, - name: Test.Supervisor.Cache + name: :"cache_supervisor_#{test}" ) %{id: first_id} = site1 = insert(:site, domain: "site1.example.com") @@ -58,7 +58,7 @@ defmodule Plausible.Site.CacheTest do Supervisor.start_link( [{Cache, [cache_name: test, child_id: :test_cache_caches_revenue_goals]}], strategy: :one_for_one, - name: Test.Supervisor.Cache + name: :"cache_supervisor_#{test}" ) %{id: site_id} = site = insert(:site, domain: "site1.example.com") @@ -89,7 +89,7 @@ defmodule Plausible.Site.CacheTest do Supervisor.start_link( [{Cache, [cache_name: test, child_id: :test_revenue_goals_event_refresh]}], strategy: :one_for_one, - name: Test.Supervisor.Cache + name: :"cache_supervisor_#{test}" ) yesterday = DateTime.utc_now() |> DateTime.add(-1 * 60 * 60 * 24)