percona-server: avoid overwrite socket files when running test

Signed-off-by: Jaehoon You <teslamint@gmail.com>

Closes #13957.

Signed-off-by: Alex Dunn <dunn.alex@gmail.com>
master
Jaehoon You 2017-06-14 12:21:11 +09:00 committed by Alex Dunn
parent 987a2b0e78
commit 03f6d843be
1 changed files with 3 additions and 3 deletions

View File

@ -184,12 +184,12 @@ class PerconaServer < Formula
# mysql throws error if any file exists in the data directory # mysql throws error if any file exists in the data directory
system "#{bin}/mysqld", "--log-error-verbosity=3", "--initialize-insecure", "--datadir=#{testpath}/mysql", "--user=#{ENV["USER"]}" system "#{bin}/mysqld", "--log-error-verbosity=3", "--initialize-insecure", "--datadir=#{testpath}/mysql", "--user=#{ENV["USER"]}"
pid = fork do pid = fork do
exec "#{opt_bin}/mysqld_safe", "--datadir=#{testpath}/mysql", "--user=#{ENV["USER"]}", "--bind-address=127.0.0.1", "--port=3307" exec "#{opt_bin}/mysqld_safe", "--datadir=#{testpath}/mysql", "--user=#{ENV["USER"]}", "--bind-address=127.0.0.1", "--port=3307", "--socket=#{testpath}/mysql.sock"
end end
sleep 3 sleep 3
system "#{bin}/mysql", "--verbose", "--port=3307", "--user=root", "--execute=source #{testpath/"mysql_test.sql"}" system "#{bin}/mysql", "--verbose", "--host=127.0.0.1", "--port=3307", "--user=root", "--execute=source #{testpath/"mysql_test.sql"}"
ensure ensure
system "#{bin}/mysqladmin", "shutdown", "--user=root", "--port=3307" system "#{bin}/mysqladmin", "shutdown", "--user=root", "--host=127.0.0.1", "--port=3307"
Process.wait pid Process.wait pid
end end
end end