diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-12-17 15:05:50 +0200 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-12-17 15:05:50 +0200 |
commit | c8853ae5e5fefac9eae7815a7977d73e88c3fea5 (patch) | |
tree | cf85dbae9b4ee145b5311bbaac487c5fd4b66087 /mysql-test/mysql-test-run.pl | |
parent | 4be65039b7b635508c84ca15a03a217e53ae4d6b (diff) | |
parent | db5cbc8252f6bb56877d885a6203db5942399926 (diff) | |
download | mariadb-git-c8853ae5e5fefac9eae7815a7977d73e88c3fea5.tar.gz |
merge
Diffstat (limited to 'mysql-test/mysql-test-run.pl')
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 1348d0f991b..7c4713bf78f 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'"); @@ -860,7 +864,7 @@ sub command_line_setup { my $opt_list_options; # Read the command line options - # Note: Keep list, and the order, in sync with usage at end of this file + # Note: Keep list in sync with usage at end of this file Getopt::Long::Configure("pass_through"); my %options=( # Control what engine/variation to run @@ -896,6 +900,7 @@ sub command_line_setup { 'combination=s' => \@opt_combinations, 'skip-combinations' => \&collect_option, 'experimental=s' => \@opt_experimentals, + # skip-im is deprecated and silently ignored 'skip-im' => \&ignore_option, # Specify ports @@ -988,6 +993,7 @@ sub command_line_setup { 'max-connections=i' => \$opt_max_connections, 'help|h' => \$opt_usage, + # list-options is internal, not listed in help 'list-options' => \$opt_list_options, ); @@ -3690,7 +3696,6 @@ sub run_testcase ($) { # ---------------------------------------------------- # Check if it was an expected crash # ---------------------------------------------------- - SRVDIED: my $check_crash = check_expected_crash_and_restart($proc); if ($check_crash) { @@ -3700,6 +3705,7 @@ sub run_testcase ($) { next; } + SRVDIED: # ---------------------------------------------------- # Stop the test case timer # ---------------------------------------------------- @@ -4249,7 +4255,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'; @@ -5376,6 +5387,8 @@ sub valgrind_arguments { # sub valgrind_exit_reports() { + my $found_err= 0; + foreach my $log_file (keys %mysqld_logs) { my @culprits= (); @@ -5411,7 +5424,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+== //; @@ -5428,8 +5441,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; } # @@ -5463,7 +5479,7 @@ Options to control what engine/variation to run defaults-file=<config template> Use fixed config template for all tests - defaults_extra_file=<config template> Extra config template to add to + defaults-extra-file=<config template> Extra config template to add to all generated configs combination=<opt> Use at least twice to run tests with specified options to mysqld @@ -5554,7 +5570,7 @@ Options for debugging the product test(s) manual-ddd Let user manually start mysqld in ddd, before running test(s) - strace-client=[path] Create strace output for mysqltest client, optionally + strace-client[=path] Create strace output for mysqltest client, optionally specifying name and path to the trace program to use. Example: $0 --strace-client=ktrace max-save-core Limit the number of core files saved (to avoid filling @@ -5587,7 +5603,7 @@ Options for valgrind Misc options user=USER User for connecting to mysqld(default: $opt_user) comment=STR Write STR to the output - notimer Don't show test case execution time + timer Show test case execution time. verbose More verbose output(use multiple times for even more) verbose-restart Write when and why servers are restarted start Only initialize and start the servers, using the @@ -5627,6 +5643,7 @@ Misc options actions. Disable facility with NUM=0. gcov Collect coverage information after the test. The result is a gcov file per source and header file. + gprof Collect profiling information using gprof. experimental=<file> Refer to list of tests considered experimental; failures will be marked exp-fail instead of fail. report-features First run a "test" that reports mysql features @@ -5635,6 +5652,10 @@ Misc options *previous* test started max-connections=N Max number of open connection to server in mysqltest +Some options that control enabling a feature for normal test runs, +can be turned off by prepending 'no' to the option, e.g. --notimer. +This applies to reorder, timer, check-testcases and warnings. + HERE exit(1); |