fix: removed problems caused by concurrency

This commit is contained in:
2026-04-25 18:51:55 +02:00
parent e20913b8e5
commit 7c73b984dc
4 changed files with 243 additions and 61 deletions

View File

@@ -55,6 +55,30 @@ defmodule BDS.Repo.BootstrapTest do
assert %Project{id: "default", name: "My Blog", is_active: true} = BDS.Projects.get_active_project()
end
test "dev repo config disables query logging by default" do
config_path = Path.expand("../../../config/config.exs", __DIR__)
config = Config.Reader.read!(config_path, env: :dev)
repo_config =
config
|> Keyword.fetch!(:bds)
|> Keyword.fetch!(BDS.Repo)
assert repo_config[:log] == false
end
test "dev repo config sets a rebuild-safe sqlite busy timeout" do
config_path = Path.expand("../../../config/config.exs", __DIR__)
config = Config.Reader.read!(config_path, env: :dev)
repo_config =
config
|> Keyword.fetch!(:bds)
|> Keyword.fetch!(BDS.Repo)
assert repo_config[:busy_timeout] == 15_000
end
defmodule RepoConfigBackup do
def put_env do
Process.put({__MODULE__, :temp_repo_config}, Application.get_env(:bds, TempRepo))