Commit f43726a1 authored by Aleksey Midenkov's avatar Aleksey Midenkov

Scipts: --tail-lines option for mtr

parent 7153ff85
...@@ -220,6 +220,7 @@ our @opt_extra_mysqld_opt; ...@@ -220,6 +220,7 @@ our @opt_extra_mysqld_opt;
our @opt_mysqld_envs; our @opt_mysqld_envs;
my $opt_stress; my $opt_stress;
my $opt_tail_lines= 20;
my $opt_dry_run; my $opt_dry_run;
...@@ -1205,6 +1206,7 @@ sub command_line_setup { ...@@ -1205,6 +1206,7 @@ sub command_line_setup {
'report-times' => \$opt_report_times, 'report-times' => \$opt_report_times,
'result-file' => \$opt_resfile, 'result-file' => \$opt_resfile,
'stress=s' => \$opt_stress, 'stress=s' => \$opt_stress,
'tail-lines=i' => \$opt_tail_lines,
'dry-run' => \$opt_dry_run, 'dry-run' => \$opt_dry_run,
'help|h' => \$opt_usage, 'help|h' => \$opt_usage,
...@@ -4856,7 +4858,7 @@ sub report_failure_and_restart ($) { ...@@ -4856,7 +4858,7 @@ sub report_failure_and_restart ($) {
$tinfo->{comment}.= $tinfo->{comment}.=
"The result from queries just before the failure was:". "The result from queries just before the failure was:".
"\n< snip >\n". "\n< snip >\n".
mtr_lastlinesfromfile($log_file_name, 20)."\n"; mtr_lastlinesfromfile($log_file_name, $opt_tail_lines)."\n";
} }
} }
} }
...@@ -5538,7 +5540,7 @@ sub start_mysqltest ($) { ...@@ -5538,7 +5540,7 @@ sub start_mysqltest ($) {
mtr_add_arg($args, "--test-file=%s", $tinfo->{'path'}); mtr_add_arg($args, "--test-file=%s", $tinfo->{'path'});
# Number of lines of resut to include in failure report # Number of lines of resut to include in failure report
mtr_add_arg($args, "--tail-lines=20"); mtr_add_arg($args, "--tail-lines=%d", $opt_tail_lines);
if ( defined $tinfo->{'result_file'} ) { if ( defined $tinfo->{'result_file'} ) {
mtr_add_arg($args, "--result-file=%s", $tinfo->{'result_file'}); mtr_add_arg($args, "--result-file=%s", $tinfo->{'result_file'});
...@@ -6186,6 +6188,8 @@ Misc options ...@@ -6186,6 +6188,8 @@ Misc options
phases of test execution. phases of test execution.
stress=ARGS Run stress test, providing options to stress=ARGS Run stress test, providing options to
mysql-stress-test.pl. Options are separated by comma. mysql-stress-test.pl. Options are separated by comma.
tail-lines=N Number of lines of the result to include in a failure
report.
Some options that control enabling a feature for normal test runs, Some options that control enabling a feature for normal test runs,
can be turned off by prepending 'no' to the option, e.g. --notimer. can be turned off by prepending 'no' to the option, e.g. --notimer.
......
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