From 6437c0356a1d9730213183a7b8ed1dd24c3bf318 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jun 2007 12:26:21 +0200 Subject: 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 --- mysql-test/lib/mtr_timer.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'mysql-test/lib/mtr_timer.pl') diff --git a/mysql-test/lib/mtr_timer.pl b/mysql-test/lib/mtr_timer.pl index 523799f7cf5..86a9f58514f 100644 --- a/mysql-test/lib/mtr_timer.pl +++ b/mysql-test/lib/mtr_timer.pl @@ -97,9 +97,14 @@ sub mtr_timer_start($$$) { # clearing the signal handler. $SIG{INT}= 'DEFAULT'; + $SIG{TERM}= sub { + mtr_verbose("timer woke up, exiting!"); + exit(0); + }; + $0= "mtr_timer(timers,$name,$duration)"; - mtr_verbose("timer child $name, sleep $duration"); sleep($duration); + mtr_verbose("timer expired after $duration seconds"); exit(0); } } @@ -118,7 +123,7 @@ sub mtr_timer_stop ($$) { # FIXME as Cygwin reuses pids fast, maybe check that is # the expected process somehow?! - kill(9, $tpid); + kill(15, $tpid); # As the timers are so simple programs, we trust them to terminate, # and use blocking wait for it. We wait just to avoid a zombie. -- cgit v1.2.1