mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug#25657 mysql-test-run.pl kill itself under ActiveState perl
- Various fixes for running mysql-test-run.pl on ActiveState perl for windows. Reading it's source in win32/win32.c helps... mysql-test/lib/mtr_process.pl: Use "real_pid" when killing the process on ActiveState perl for windows Wait blocking for the pseudo pid to exit. Change "sleep_until_file_created" to return 1 when pidfile has been created - this should avoid early wakeup if $pid was 0 mysql-test/lib/mtr_timer.pl: Wake timer process with signal 15 to avoid to avoid resource leak on ActiveState perl for windows. Install signal handler in timer process to exit gracefully mysql-test/mysql-test-run.pl: Read "real_pid" of process from pid_file - to be used when killing the process on ActiveState perl Drop the --console option to mysqld Pass "real_pid" to mtr_check_stop_server so it can select to use it Correct two argument declarations
This commit is contained in:
@ -2579,10 +2579,19 @@ sub ndbcluster_wait_started($$){
|
||||
sub mysqld_wait_started($){
|
||||
my $mysqld= shift;
|
||||
|
||||
my $res= sleep_until_file_created($mysqld->{'path_pid'},
|
||||
$mysqld->{'start_timeout'},
|
||||
$mysqld->{'pid'});
|
||||
return $res == 0;
|
||||
if (sleep_until_file_created($mysqld->{'path_pid'},
|
||||
$mysqld->{'start_timeout'},
|
||||
$mysqld->{'pid'}) == 0)
|
||||
{
|
||||
# Failed to wait for pid file
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Get the "real pid" of the process, it will be used for killing
|
||||
# the process in ActiveState's perl on windows
|
||||
$mysqld->{'real_pid'}= mtr_get_pid_from_file($mysqld->{'path_pid'});
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -3720,7 +3729,6 @@ sub mysqld_arguments ($$$$) {
|
||||
|
||||
mtr_add_arg($args, "%s--no-defaults", $prefix);
|
||||
|
||||
mtr_add_arg($args, "%s--console", $prefix);
|
||||
mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
|
||||
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
|
||||
|
||||
@ -4093,6 +4101,7 @@ sub stop_all_servers () {
|
||||
|
||||
push(@kill_pids,{
|
||||
pid => $mysqld->{'pid'},
|
||||
real_pid => $mysqld->{'real_pid'},
|
||||
pidfile => $mysqld->{'path_pid'},
|
||||
sockfile => $mysqld->{'path_sock'},
|
||||
port => $mysqld->{'port'},
|
||||
@ -4300,6 +4309,7 @@ sub run_testcase_stop_servers($$$) {
|
||||
|
||||
push(@kill_pids,{
|
||||
pid => $mysqld->{'pid'},
|
||||
real_pid => $mysqld->{'real_pid'},
|
||||
pidfile => $mysqld->{'path_pid'},
|
||||
sockfile => $mysqld->{'path_sock'},
|
||||
port => $mysqld->{'port'},
|
||||
@ -4351,6 +4361,7 @@ sub run_testcase_stop_servers($$$) {
|
||||
|
||||
push(@kill_pids,{
|
||||
pid => $mysqld->{'pid'},
|
||||
real_pid => $mysqld->{'real_pid'},
|
||||
pidfile => $mysqld->{'path_pid'},
|
||||
sockfile => $mysqld->{'path_sock'},
|
||||
port => $mysqld->{'port'},
|
||||
@ -4775,12 +4786,10 @@ sub run_mysqltest ($) {
|
||||
mtr_add_arg($args, "%s", $_) for @args_saved;
|
||||
}
|
||||
|
||||
mtr_add_arg($args, "--test-file");
|
||||
mtr_add_arg($args, $tinfo->{'path'});
|
||||
mtr_add_arg($args, "--test-file=%s", $tinfo->{'path'});
|
||||
|
||||
if ( defined $tinfo->{'result_file'} ) {
|
||||
mtr_add_arg($args, "--result-file");
|
||||
mtr_add_arg($args, $tinfo->{'result_file'});
|
||||
mtr_add_arg($args, "--result-file=%s", $tinfo->{'result_file'});
|
||||
}
|
||||
|
||||
if ( $opt_record )
|
||||
|
Reference in New Issue
Block a user