mirror of
https://github.com/MariaDB/server.git
synced 2025-09-03 20:43:11 +03:00
Merge shellback.(none):/home/msvensson/mysql/mysql-4.1-maint
into shellback.(none):/home/msvensson/mysql/mysql-5.0-maint
This commit is contained in:
@@ -130,16 +130,11 @@ sub mtr_report_test_failed ($) {
|
|||||||
my $tinfo= shift;
|
my $tinfo= shift;
|
||||||
|
|
||||||
$tinfo->{'result'}= 'MTR_RES_FAILED';
|
$tinfo->{'result'}= 'MTR_RES_FAILED';
|
||||||
if ( $tinfo->{'timeout'} )
|
if ( defined $tinfo->{'timeout'} )
|
||||||
{
|
{
|
||||||
print "[ fail ] timeout\n";
|
print "[ fail ] timeout\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
elsif ( $tinfo->{'ndb_test'} and $::cluster->[0]->{'installed_ok'} eq "NO")
|
|
||||||
{
|
|
||||||
print "[ fail ] ndbcluster start failure\n";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "[ fail ]\n";
|
print "[ fail ]\n";
|
||||||
|
@@ -4,23 +4,22 @@
|
|||||||
# and is part of the translation of the Bourne shell script with the
|
# and is part of the translation of the Bourne shell script with the
|
||||||
# same name.
|
# same name.
|
||||||
|
|
||||||
use Carp qw(cluck);
|
|
||||||
use Socket;
|
use Socket;
|
||||||
use Errno;
|
use Errno;
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
#use POSIX ":sys_wait_h";
|
#use POSIX ":sys_wait_h";
|
||||||
use POSIX 'WNOHANG';
|
#use POSIX 'WNOHANG';
|
||||||
|
|
||||||
sub mtr_init_timers ();
|
sub mtr_init_timers ();
|
||||||
sub mtr_timer_start($$$);
|
sub mtr_timer_start($$$);
|
||||||
sub mtr_timer_stop($$);
|
sub mtr_timer_stop($$);
|
||||||
sub mtr_timer_stop_all($);
|
sub mtr_timer_stop_all($);
|
||||||
sub mtr_timer_waitpid($$$);
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# Initiate a structure shared by all timers
|
# Initiate the structure shared by all timers
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
@@ -35,17 +34,19 @@ sub mtr_init_timers () {
|
|||||||
# Start, stop and poll a timer
|
# Start, stop and poll a timer
|
||||||
#
|
#
|
||||||
# As alarm() isn't portable to Windows, we use separate processes to
|
# As alarm() isn't portable to Windows, we use separate processes to
|
||||||
# implement timers. That is why there is a mtr_timer_waitpid(), as this
|
# implement timers.
|
||||||
# is where we catch a timeout.
|
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
sub mtr_timer_start($$$) {
|
sub mtr_timer_start($$$) {
|
||||||
my ($timers,$name,$duration)= @_;
|
my ($timers,$name,$duration)= @_;
|
||||||
|
|
||||||
|
mtr_verbose("mtr_timer_start: $name, $duration");
|
||||||
|
|
||||||
if ( exists $timers->{'timers'}->{$name} )
|
if ( exists $timers->{'timers'}->{$name} )
|
||||||
{
|
{
|
||||||
# We have an old running timer, kill it
|
# We have an old running timer, kill it
|
||||||
|
mtr_verbose("There is an old timer running");
|
||||||
mtr_timer_stop($timers,$name);
|
mtr_timer_stop($timers,$name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,7 +58,7 @@ sub mtr_timer_start($$$) {
|
|||||||
{
|
{
|
||||||
if ( $! == $!{EAGAIN} ) # See "perldoc Errno"
|
if ( $! == $!{EAGAIN} ) # See "perldoc Errno"
|
||||||
{
|
{
|
||||||
mtr_debug("Got EAGAIN from fork(), sleep 1 second and redo");
|
mtr_warning("Got EAGAIN from fork(), sleep 1 second and redo");
|
||||||
sleep(1);
|
sleep(1);
|
||||||
redo FORK;
|
redo FORK;
|
||||||
}
|
}
|
||||||
@@ -70,6 +71,7 @@ sub mtr_timer_start($$$) {
|
|||||||
if ( $tpid )
|
if ( $tpid )
|
||||||
{
|
{
|
||||||
# Parent, record the information
|
# Parent, record the information
|
||||||
|
mtr_verbose("timer parent, record info($name, $tpid, $duration)");
|
||||||
$timers->{'timers'}->{$name}->{'pid'}= $tpid;
|
$timers->{'timers'}->{$name}->{'pid'}= $tpid;
|
||||||
$timers->{'timers'}->{$name}->{'duration'}= $duration;
|
$timers->{'timers'}->{$name}->{'duration'}= $duration;
|
||||||
$timers->{'pids'}->{$tpid}= $name;
|
$timers->{'pids'}->{$tpid}= $name;
|
||||||
@@ -85,6 +87,7 @@ sub mtr_timer_start($$$) {
|
|||||||
$SIG{INT}= 'DEFAULT';
|
$SIG{INT}= 'DEFAULT';
|
||||||
|
|
||||||
$0= "mtr_timer(timers,$name,$duration)";
|
$0= "mtr_timer(timers,$name,$duration)";
|
||||||
|
mtr_verbose("timer child $name, sleep $duration");
|
||||||
sleep($duration);
|
sleep($duration);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
@@ -95,9 +98,12 @@ sub mtr_timer_start($$$) {
|
|||||||
sub mtr_timer_stop ($$) {
|
sub mtr_timer_stop ($$) {
|
||||||
my ($timers,$name)= @_;
|
my ($timers,$name)= @_;
|
||||||
|
|
||||||
|
mtr_verbose("mtr_timer_stop: $name");
|
||||||
|
|
||||||
if ( exists $timers->{'timers'}->{$name} )
|
if ( exists $timers->{'timers'}->{$name} )
|
||||||
{
|
{
|
||||||
my $tpid= $timers->{'timers'}->{$name}->{'pid'};
|
my $tpid= $timers->{'timers'}->{$name}->{'pid'};
|
||||||
|
mtr_verbose("Stopping timer with pid $tpid");
|
||||||
|
|
||||||
# FIXME as Cygwin reuses pids fast, maybe check that is
|
# FIXME as Cygwin reuses pids fast, maybe check that is
|
||||||
# the expected process somehow?!
|
# the expected process somehow?!
|
||||||
@@ -114,7 +120,7 @@ sub mtr_timer_stop ($$) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mtr_debug("Asked to stop timer \"$name\" not started");
|
mtr_error("Asked to stop timer \"$name\" not started");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -391,6 +391,8 @@ sub main () {
|
|||||||
my ($need_ndbcluster,$need_im);
|
my ($need_ndbcluster,$need_im);
|
||||||
foreach my $test (@$tests)
|
foreach my $test (@$tests)
|
||||||
{
|
{
|
||||||
|
next if $test->{skip};
|
||||||
|
|
||||||
$need_ndbcluster||= $test->{ndb_test};
|
$need_ndbcluster||= $test->{ndb_test};
|
||||||
$need_im||= $test->{component_id} eq 'im';
|
$need_im||= $test->{component_id} eq 'im';
|
||||||
|
|
||||||
@@ -2753,10 +2755,9 @@ sub run_testcase_check_skip_test($)
|
|||||||
# If test needs this cluster, check it was installed ok
|
# If test needs this cluster, check it was installed ok
|
||||||
if ( !$cluster->{'installed_ok'} )
|
if ( !$cluster->{'installed_ok'} )
|
||||||
{
|
{
|
||||||
mtr_tofile($path_timefile,
|
|
||||||
"Test marked as failed because $cluster->{'name'} " .
|
|
||||||
"was not installed ok!");
|
|
||||||
mtr_report_test_name($tinfo);
|
mtr_report_test_name($tinfo);
|
||||||
|
$tinfo->{comment}=
|
||||||
|
"Cluster $cluster->{'name'} was not installed ok";
|
||||||
mtr_report_test_failed($tinfo);
|
mtr_report_test_failed($tinfo);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -2879,10 +2880,8 @@ sub run_testcase ($) {
|
|||||||
# Can't restart a running server that may be in use
|
# Can't restart a running server that may be in use
|
||||||
if ( $glob_use_running_server )
|
if ( $glob_use_running_server )
|
||||||
{
|
{
|
||||||
$tinfo->{'skip'}= 1;
|
|
||||||
$tinfo->{'comment'}= "Can't restart a running server";
|
|
||||||
|
|
||||||
mtr_report_test_name($tinfo);
|
mtr_report_test_name($tinfo);
|
||||||
|
$tinfo->{comment}= "Can't restart a running server";
|
||||||
mtr_report_test_skipped($tinfo);
|
mtr_report_test_skipped($tinfo);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2932,16 +2931,16 @@ sub run_testcase ($) {
|
|||||||
$tinfo->{'timeout'}= 1; # Mark as timeout
|
$tinfo->{'timeout'}= 1; # Mark as timeout
|
||||||
report_failure_and_restart($tinfo);
|
report_failure_and_restart($tinfo);
|
||||||
}
|
}
|
||||||
|
elsif ( $res == 1 )
|
||||||
|
{
|
||||||
|
# Test case failure reported by mysqltest
|
||||||
|
report_failure_and_restart($tinfo);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
# Test case failed, if in control mysqltest returns 1
|
# mysqltest failed, probably crashed
|
||||||
if ( $res != 1 )
|
$tinfo->{comment}=
|
||||||
{
|
"mysqltest returned unexpected code $res, it has probably crashed";
|
||||||
mtr_tofile($path_timefile,
|
|
||||||
"mysqltest returned unexpected code $res, " .
|
|
||||||
"it has probably crashed");
|
|
||||||
}
|
|
||||||
|
|
||||||
report_failure_and_restart($tinfo);
|
report_failure_and_restart($tinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user