Commit 02dc75a2 authored by Bjorn Munch's avatar Bjorn Munch

Bug #12373916 MTR SHOULD FLAG PRESENCE OF VALGRIND MEMORY LEAK REPORTS IN A CLEARER WAY

Produce a pseudo test valgrind_reports.
Reports are generated by each worker, don't want one test for each.
Send message 'VALGREP' if report was found, master thread will pick this up
parent 91c3b427
...@@ -280,6 +280,7 @@ my $opt_valgrind_mysqltest= 0; ...@@ -280,6 +280,7 @@ my $opt_valgrind_mysqltest= 0;
my @default_valgrind_args= ("--show-reachable=yes"); my @default_valgrind_args= ("--show-reachable=yes");
my @valgrind_args; my @valgrind_args;
my $opt_valgrind_path; my $opt_valgrind_path;
my $valgrind_reports= 0;
my $opt_callgrind; my $opt_callgrind;
my %mysqld_logs; my %mysqld_logs;
my $opt_debug_sync_timeout= 300; # Default timeout for WAIT_FOR actions. my $opt_debug_sync_timeout= 300; # Default timeout for WAIT_FOR actions.
...@@ -504,6 +505,25 @@ sub main { ...@@ -504,6 +505,25 @@ sub main {
push @$completed, run_ctest() if $opt_ctest; push @$completed, run_ctest() if $opt_ctest;
if ($opt_valgrind) {
# Create minimalistic "test" for the reporting
my $tinfo = My::Test->new
(
name => 'valgrind_report',
);
# Set dummy worker id to align report with normal tests
$tinfo->{worker} = 0 if $opt_parallel > 1;
if ($valgrind_reports) {
$tinfo->{result}= 'MTR_RES_FAILED';
$tinfo->{comment}= "Valgrind reported failures at shutdown, see above";
$tinfo->{failures}= 1;
} else {
$tinfo->{result}= 'MTR_RES_PASSED';
}
mtr_report_test($tinfo);
push @$completed, $tinfo;
}
mtr_print_line(); mtr_print_line();
if ( $opt_gcov ) { if ( $opt_gcov ) {
...@@ -704,6 +724,9 @@ sub run_test_server ($$$) { ...@@ -704,6 +724,9 @@ sub run_test_server ($$$) {
elsif ($line =~ /^SPENT/) { elsif ($line =~ /^SPENT/) {
add_total_times($line); add_total_times($line);
} }
elsif ($line eq 'VALGREP' && $opt_valgrind) {
$valgrind_reports= 1;
}
else { else {
mtr_error("Unknown response: '$line' from client"); mtr_error("Unknown response: '$line' from client");
} }
...@@ -889,6 +912,7 @@ sub run_worker ($) { ...@@ -889,6 +912,7 @@ sub run_worker ($) {
my $valgrind_reports= 0; my $valgrind_reports= 0;
if ($opt_valgrind_mysqld) { if ($opt_valgrind_mysqld) {
$valgrind_reports= valgrind_exit_reports(); $valgrind_reports= valgrind_exit_reports();
print $server "VALGREP\n" if $valgrind_reports;
} }
if ( $opt_gprof ) { if ( $opt_gprof ) {
gprof_collect (find_mysqld($basedir), keys %gprof_dirs); gprof_collect (find_mysqld($basedir), keys %gprof_dirs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment