diff --git a/integration_test/test/code_generation/app_with_sqlite3_adapter_test.exs b/integration_test/test/code_generation/app_with_sqlite3_adapter_test.exs index 29dbf9fa62..08ea45ac22 100644 --- a/integration_test/test/code_generation/app_with_sqlite3_adapter_test.exs +++ b/integration_test/test/code_generation/app_with_sqlite3_adapter_test.exs @@ -1,6 +1,16 @@ defmodule Phoenix.Integration.CodeGeneration.AppWithSQLite3AdapterTest do use Phoenix.Integration.CodeGeneratorCase, async: true + defp increase_busy_timeout(app_root_path) do + modify_file(Path.join(app_root_path, "config/test.exs"), fn file -> + String.replace(file, "config :dayzee, Dayzee.Repo,", """ + config :dayzee, Dayzee.Repo, + busy_timeout: 10_000, + queue_target: 500 + """) + end) + end + describe "phx.gen.html" do @tag database: :sqlite3 test "has a passing test suite" do @@ -8,7 +18,12 @@ defmodule Phoenix.Integration.CodeGeneration.AppWithSQLite3AdapterTest do {app_root_path, _} = generate_phoenix_app(tmp_dir, "default_sqlite3_app", ["--database", "sqlite3"]) - mix_run!(~w(phx.gen.html Blog Post posts title body:string status:enum:unpublished:published:deleted), app_root_path) + increase_busy_timeout(app_root_path) + + mix_run!( + ~w(phx.gen.html Blog Post posts title body:string status:enum:unpublished:published:deleted), + app_root_path + ) modify_file(Path.join(app_root_path, "lib/default_sqlite3_app_web/router.ex"), fn file -> inject_before_final_end(file, """ @@ -34,7 +49,12 @@ defmodule Phoenix.Integration.CodeGeneration.AppWithSQLite3AdapterTest do {app_root_path, _} = generate_phoenix_app(tmp_dir, "default_sqlite3_app", ["--database", "sqlite3"]) - mix_run!(~w(phx.gen.json Blog Post posts title body:string status:enum:unpublished:published:deleted), app_root_path) + increase_busy_timeout(app_root_path) + + mix_run!( + ~w(phx.gen.json Blog Post posts title body:string status:enum:unpublished:published:deleted), + app_root_path + ) modify_file(Path.join(app_root_path, "lib/default_sqlite3_app_web/router.ex"), fn file -> inject_before_final_end(file, """ @@ -60,7 +80,12 @@ defmodule Phoenix.Integration.CodeGeneration.AppWithSQLite3AdapterTest do {app_root_path, _} = generate_phoenix_app(tmp_dir, "default_sqlite3_app", ["--database", "sqlite3", "--live"]) - mix_run!(~w(phx.gen.live Blog Post posts title body:string status:enum:unpublished:published:deleted), app_root_path) + increase_busy_timeout(app_root_path) + + mix_run!( + ~w(phx.gen.live Blog Post posts title body:string status:enum:unpublished:published:deleted), + app_root_path + ) modify_file(Path.join(app_root_path, "lib/default_sqlite3_app_web/router.ex"), fn file -> inject_before_final_end(file, """ @@ -108,7 +133,10 @@ defmodule Phoenix.Integration.CodeGeneration.AppWithSQLite3AdapterTest do @tag database: :sqlite3 test "has a passing test suite (--live)" do with_installer_tmp("app_with_defaults", fn tmp_dir -> - {app_root_path, _} = generate_phoenix_app(tmp_dir, "default_app", ["--database", "sqlite3"]) + {app_root_path, _} = + generate_phoenix_app(tmp_dir, "default_app", ["--database", "sqlite3"]) + + increase_busy_timeout(app_root_path) mix_run!(~w(phx.gen.auth Accounts User users --live), app_root_path) @@ -119,7 +147,10 @@ defmodule Phoenix.Integration.CodeGeneration.AppWithSQLite3AdapterTest do test "has a passing test suite (--no-live)" do with_installer_tmp("app_with_defaults", fn tmp_dir -> - {app_root_path, _} = generate_phoenix_app(tmp_dir, "default_app", ["--database", "sqlite3"]) + {app_root_path, _} = + generate_phoenix_app(tmp_dir, "default_app", ["--database", "sqlite3"]) + + increase_busy_timeout(app_root_path) mix_run!(~w(phx.gen.auth Accounts User users --no-live), app_root_path)