Skip to content

Commit c14f47c

Browse files
fix test
1 parent d93fbd4 commit c14f47c

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

integration_test/myxql/storage_test.exs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ defmodule Ecto.Integration.StorageTest do
122122
end
123123

124124
test "structure load will fail on SQL errors" do
125+
create_database()
125126
File.mkdir_p!(tmp_path())
126127
error_path = Path.join(tmp_path(), "error.sql")
127128
File.write!(error_path, "SELECT 1; SELECKT 1; SELECT 2;")
@@ -130,6 +131,8 @@ defmodule Ecto.Integration.StorageTest do
130131
Ecto.Adapters.MyXQL.structure_load(tmp_path(), [dump_path: error_path] ++ params())
131132

132133
assert message =~ ~r/ERROR.*SELECKT/
134+
after
135+
drop_database()
133136
end
134137

135138
test "storage status is up when database is created" do

lib/ecto/adapters/myxql.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,7 @@ defmodule Ecto.Adapters.MyXQL do
587587
env: validate_env(env),
588588
args: args
589589
]
590+
590591
# Trap exits in case mysql dies in the middle of execution so that we can surface the error
591592
Process.flag(:trap_exit, true)
592593
port = Port.open({:spawn_executable, abs_cmd}, port_opts)

0 commit comments

Comments
 (0)