test(seeds): drop the dead per-process seeds-run guard
This commit is contained in:
parent
18fb954f73
commit
3bd55fbfec
1 changed files with 2 additions and 12 deletions
|
|
@ -24,21 +24,11 @@ defmodule Mv.SeedsTest do
|
|||
|
||||
require Ash.Query
|
||||
|
||||
# Module attribute to track if seeds have been run
|
||||
# This allows us to run seeds once per test module while respecting sandbox isolation
|
||||
@seeds_run_key :seeds_test_run
|
||||
|
||||
setup do
|
||||
system_actor = Mv.Helpers.SystemActor.get_system_actor()
|
||||
|
||||
# Run seeds once per test process (due to sandbox isolation, each test runs in its own process)
|
||||
# Process.get/put ensures seeds are only executed once per test process, not once per test
|
||||
# Note: With async: false and sandbox isolation, this effectively runs seeds once per test,
|
||||
# but the guard prevents multiple executions within the same test process if setup is called multiple times
|
||||
unless Process.get(@seeds_run_key) do
|
||||
# Each test runs in its own sandbox-owned process, so seeds are loaded once per test.
|
||||
Code.eval_file("priv/repo/seeds.exs")
|
||||
Process.put(@seeds_run_key, true)
|
||||
end
|
||||
|
||||
%{actor: system_actor}
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue