summaryrefslogtreecommitdiff
path: root/mysql-test/mysql-test-run.pl
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2009-04-08 18:55:26 +0200
committerunknown <knielsen@knielsen-hq.org>2009-04-08 18:55:26 +0200
commitc558b3e06885aecccb2cbcc250918745712f2f65 (patch)
tree81e5535a4b63110a5b9a2d8112ca913219c97e88 /mysql-test/mysql-test-run.pl
parent51d903630b13b3408997623ed33ab3619d97eb78 (diff)
downloadmariadb-git-c558b3e06885aecccb2cbcc250918745712f2f65.tar.gz
Fix Valgrind errors seen in buildbot.
Fix mysql-test-run.pl to not terminate early when warnings in error logs are detected during server shutdown. Instead, give a nice summary report at the end of the failures. Fix code to make 100% sure no failures will go undetected. Revert earlier wrong change. Fix race with port allocation semaphore file permissions. Adjust testsuite to copy with new PBXT engine now in the tree. The PBXT engine causes an extra table to appear in the INFORMATION_SCHEMA. This causes different output for a few test cases. dbug/dbug.c: If DbugParse() is called multiple times, the stack->keywords for the top stack frame could be overwritten without being freed, causing a memory leak reported by Valgrind. include/my_global.h: Add useful macro for different values when Valgrind (HAVE_purify) and not. mysql-test/extra/rpl_tests/rpl_auto_increment.test: Omit pbxt variables from show variables output. mysql-test/include/have_pbxt.inc: Add facility to disable test if PBXT engine is not available. mysql-test/lib/mtr_report.pm: Give a nice summary report at the end of tests of any warnings seen in logs during server shutdowns. mysql-test/lib/mtr_unique.pm: Move chmod 777 to greatly reduce the risk of leaving the port semaphore file unaccessible bu other users. mysql-test/mysql-test-run.pl: Don't abort in case of warnings detected, instead give a nice summary report. Fix code to make 100% sure no failures will go undetected. Revert earlier wrong change when master disconnects early. mysql-test/r/information_schema.result: Omit PBXT INFORMATION_SCHEMA table from output. Move part of test to information_schema_all_engines. mysql-test/r/information_schema_all_engines.result: New file for information_schema tests that depend on which engines are available. mysql-test/r/information_schema_db.result: Move part of test to information_schema_all_engines. mysql-test/r/innodb-autoinc.result: Omit pbxt variables from show variables output. mysql-test/r/mysqlshow.result: Move part of test to information_schema_all_engines. mysql-test/suite/rpl/r/rpl_auto_increment.result: Omit pbxt variables from show variables output. mysql-test/t/information_schema.test: Omit PBXT INFORMATION_SCHEMA table from output. Move part of test to information_schema_all_engines. mysql-test/t/information_schema_all_engines.test: New file for information_schema tests that depend on which engines are available. mysql-test/t/information_schema_db.test: Move part of test to information_schema_all_engines. mysql-test/t/innodb-autoinc.test: Omit pbxt variables from show variables output. mysql-test/t/mysqlshow.test: Move part of test to information_schema_all_engines. mysql-test/valgrind.supp: Add variant suppression (different system library versions). Add suppression for problem with inet_ntoa(). sql/mysqld.cc: Fix missing DBUG_RETURN. Fix uninitialised thd->connect_utime, likely introduced by pool_of_threads. sql/set_var.cc: Fix one-byte buffer overflow in several places. Fix unsafe use of String::c_ptr() of stack-allocated String buffer. sql/sql_select.cc: Silence valgrind warning due to GCC bug. sql/sql_string.h: Document potential problem with String::c_ptr() and String() constructor with caller-supplied buffer. storage/archive/azio.c: Silence Valgrind false warning for libz.
Diffstat (limited to 'mysql-test/mysql-test-run.pl')
-rwxr-xr-xmysql-test/mysql-test-run.pl27
1 files changed, 14 insertions, 13 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 7d5b5ee17b2..ca317d79f13 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -357,7 +357,8 @@ sub main {
mtr_print_thick_line();
mtr_print_header();
- my ($completed, $fail)= run_test_server($server, $tests, $opt_parallel);
+ my ($fail, $completed, $extra_warnings)=
+ run_test_server($server, $tests, $opt_parallel);
# Send Ctrl-C to any children still running
kill("INT", keys(%children));
@@ -393,10 +394,6 @@ sub main {
mtr_error("Not all tests completed");
}
- if ($fail) {
- mtr_error("Test suite failure.");
- }
-
mtr_print_line();
if ( $opt_gcov ) {
@@ -404,7 +401,7 @@ sub main {
$opt_gcov_msg, $opt_gcov_err);
}
- mtr_report_stats($completed);
+ mtr_report_stats($fail, $completed, $extra_warnings);
exit(0);
}
@@ -416,7 +413,8 @@ sub run_test_server ($$$) {
my $num_saved_cores= 0; # Number of core files saved in vardir/log/ so far.
my $num_saved_datadir= 0; # Number of datadirs saved in vardir/log/ so far.
my $num_failed_test= 0; # Number of tests failed so far
- my $test_failure= 0;
+ my $test_failure= 0; # Set true if test suite failed
+ my $extra_warnings= []; # Warnings found during server shutdowns
# Scheduler variables
my $max_ndb= $childs / 2;
@@ -450,7 +448,7 @@ sub run_test_server ($$$) {
$s->remove($sock);
if (--$childs == 0){
$suite_timeout_proc->kill();
- return ($completed, $test_failure);
+ return ($test_failure, $completed, $extra_warnings);
}
next;
}
@@ -519,14 +517,14 @@ sub run_test_server ($$$) {
# Test has failed, force is off
$suite_timeout_proc->kill();
push(@$completed, $result);
- return ($completed, 1);
+ return (1, $completed, $extra_warnings);
}
elsif ($opt_max_test_fail > 0 and
$num_failed_test >= $opt_max_test_fail) {
$suite_timeout_proc->kill();
mtr_report("Too many tests($num_failed_test) failed!",
"Terminating...");
- return (undef, 1);
+ return (1, $completed, $extra_warnings);
}
$num_failed_test++;
}
@@ -580,13 +578,14 @@ sub run_test_server ($$$) {
elsif ($line eq 'WARNINGS'){
my $fake_test= My::Test::read_test($sock);
my $test_list= join (" ", @{$fake_test->{testnames}});
+ push @$extra_warnings, $test_list;
mtr_report("***Warnings generated in error logs during shutdown ".
"after running tests: $test_list");
$test_failure= 1;
if ( !$opt_force ) {
# Test failure due to warnings, force is off
$suite_timeout_proc->kill();
- return ($completed, 1);
+ return (1, $completed, $extra_warnings);
}
} else {
mtr_error("Unknown response: '$line' from client");
@@ -666,7 +665,7 @@ sub run_test_server ($$$) {
if ( ! $suite_timeout_proc->wait_one(0) )
{
mtr_report("Test suite timeout! Terminating...");
- return (undef, 1);
+ return (1, $completed, $extra_warnings);
}
}
}
@@ -758,7 +757,9 @@ sub run_worker ($) {
}
}
- die "Internal error: should not reach this place.";
+ stop_all_servers();
+
+ exit(1);
}