summaryrefslogtreecommitdiff
path: root/mysql-test/mysql-test-run.pl
diff options
context:
space:
mode:
authorBjorn Munch <bjorn.munch@oracle.com>2010-11-27 11:51:22 +0100
committerBjorn Munch <bjorn.munch@oracle.com>2010-11-27 11:51:22 +0100
commit7197f142ccc0a867db0ced09c4dab2c1ae17c4ea (patch)
treea68ea195ae9aa047d41efc58786f871190d25638 /mysql-test/mysql-test-run.pl
parentd6d0827ec6d79326ef8443a40f06a4962af6a36f (diff)
parent067710eba1e3c958fb64fe569fae027afc65fd90 (diff)
downloadmariadb-git-7197f142ccc0a867db0ced09c4dab2c1ae17c4ea.tar.gz
merge from 5.1-mtr
Diffstat (limited to 'mysql-test/mysql-test-run.pl')
-rwxr-xr-xmysql-test/mysql-test-run.pl26
1 files changed, 20 insertions, 6 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 22c60cf1997..2740af710a7 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -569,7 +569,10 @@ sub run_test_server ($$$) {
if ( !$opt_force ) {
# Test has failed, force is off
push(@$completed, $result);
- return $completed;
+ return $completed unless $result->{'dont_kill_server'};
+ # Prevent kill of server, to get valgrind report
+ print $sock "BYE\n";
+ next;
}
elsif ($opt_max_test_fail > 0 and
$num_failed_test >= $opt_max_test_fail) {
@@ -809,13 +812,14 @@ sub run_worker ($) {
elsif ($line eq 'BYE'){
mtr_report("Server said BYE");
stop_all_servers($opt_shutdown_timeout);
+ my $valgrind_reports= 0;
if ($opt_valgrind_mysqld) {
- valgrind_exit_reports();
+ $valgrind_reports= valgrind_exit_reports();
}
if ( $opt_gprof ) {
gprof_collect (find_mysqld($basedir), keys %gprof_dirs);
}
- exit(0);
+ exit($valgrind_reports);
}
else {
mtr_error("Could not understand server, '$line'");
@@ -3680,7 +3684,6 @@ sub run_testcase ($) {
# ----------------------------------------------------
# Check if it was an expected crash
# ----------------------------------------------------
- SRVDIED:
my $check_crash = check_expected_crash_and_restart($proc);
if ($check_crash)
{
@@ -3690,6 +3693,7 @@ sub run_testcase ($) {
next;
}
+ SRVDIED:
# ----------------------------------------------------
# Stop the test case timer
# ----------------------------------------------------
@@ -4239,7 +4243,12 @@ sub after_failure ($) {
sub report_failure_and_restart ($) {
my $tinfo= shift;
- stop_all_servers();
+ if ($opt_valgrind_mysqld && ($tinfo->{'warnings'} || $tinfo->{'timeout'})) {
+ # In these cases we may want valgrind report from normal termination
+ $tinfo->{'dont_kill_server'}= 1;
+ }
+ # Shotdown properly if not to be killed (for valgrind)
+ stop_all_servers($tinfo->{'dont_kill_server'} ? $opt_shutdown_timeout : 0);
$tinfo->{'result'}= 'MTR_RES_FAILED';
@@ -5366,6 +5375,8 @@ sub valgrind_arguments {
#
sub valgrind_exit_reports() {
+ my $found_err= 0;
+
foreach my $log_file (keys %mysqld_logs)
{
my @culprits= ();
@@ -5401,7 +5412,7 @@ sub valgrind_exit_reports() {
next;
}
# This line marks the start of a valgrind report
- $found_report= 1 if $line =~ /ERROR SUMMARY:/;
+ $found_report= 1 if $line =~ /^==\d+== .* SUMMARY:/;
if ($found_report) {
$line=~ s/^==\d+== //;
@@ -5418,8 +5429,11 @@ sub valgrind_exit_reports() {
mtr_print ("Valgrind report from $log_file after tests:\n", @culprits);
mtr_print_line();
print ("$valgrind_rep\n");
+ $found_err= 1;
}
}
+
+ return $found_err;
}
#