Bug #11751927 42960: MTR2: NO MORE --STRESS PARAMETERS
Quick fix: run mysql-stress-test.pl via a wrapper test Amend mtr to run just that test when using --stress Updated mysql-stress-test.pl to exit(1) if wrong options
This commit is contained in:
parent
50f05fab28
commit
b06ebbbf36
@ -238,9 +238,9 @@ GetOptions("server-host=s", "server-logs-dir=s", "server-port=s",
|
|||||||
"test-duration=i", "test-suffix=s", "check-tests-file",
|
"test-duration=i", "test-suffix=s", "check-tests-file",
|
||||||
"verbose", "log-error-details", "cleanup", "mysqltest=s",
|
"verbose", "log-error-details", "cleanup", "mysqltest=s",
|
||||||
# OBN: (changing 'abort-on-error' to numberic for WL-4626/4685)
|
# OBN: (changing 'abort-on-error' to numberic for WL-4626/4685)
|
||||||
"abort-on-error=i" => \$opt_abort_on_error, "help") || usage();
|
"abort-on-error=i" => \$opt_abort_on_error, "help") || usage(1);
|
||||||
|
|
||||||
usage() if ($opt_help);
|
usage(0) if ($opt_help);
|
||||||
|
|
||||||
#$opt_abort_on_error=1;
|
#$opt_abort_on_error=1;
|
||||||
|
|
||||||
@ -1131,6 +1131,7 @@ sub sig_TERM_handler
|
|||||||
|
|
||||||
sub usage
|
sub usage
|
||||||
{
|
{
|
||||||
|
my $retcode= shift;
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
|
|
||||||
The MySQL Stress suite Ver $stress_suite_version
|
The MySQL Stress suite Ver $stress_suite_version
|
||||||
@ -1234,7 +1235,7 @@ perl mysql-stress-test.pl \
|
|||||||
--cleanup \
|
--cleanup \
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
exit(0);
|
exit($retcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -181,6 +181,8 @@ our @opt_combinations;
|
|||||||
our @opt_extra_mysqld_opt;
|
our @opt_extra_mysqld_opt;
|
||||||
our @opt_mysqld_envs;
|
our @opt_mysqld_envs;
|
||||||
|
|
||||||
|
my $opt_stress;
|
||||||
|
|
||||||
my $opt_compress;
|
my $opt_compress;
|
||||||
my $opt_ssl;
|
my $opt_ssl;
|
||||||
my $opt_skip_ssl;
|
my $opt_skip_ssl;
|
||||||
@ -423,8 +425,8 @@ sub main {
|
|||||||
}
|
}
|
||||||
$ENV{MTR_PARALLEL} = $opt_parallel;
|
$ENV{MTR_PARALLEL} = $opt_parallel;
|
||||||
|
|
||||||
if ($opt_parallel > 1 && $opt_start_exit) {
|
if ($opt_parallel > 1 && ($opt_start_exit || $opt_stress)) {
|
||||||
mtr_warning("Parallel and --start-and-exit cannot be combined\n" .
|
mtr_warning("Parallel cannot be used with --start-and-exit or --stress\n" .
|
||||||
"Setting parallel to 1");
|
"Setting parallel to 1");
|
||||||
$opt_parallel= 1;
|
$opt_parallel= 1;
|
||||||
}
|
}
|
||||||
@ -1174,6 +1176,7 @@ sub command_line_setup {
|
|||||||
'report-times' => \$opt_report_times,
|
'report-times' => \$opt_report_times,
|
||||||
'result-file' => \$opt_resfile,
|
'result-file' => \$opt_resfile,
|
||||||
'unit-tests!' => \$opt_ctest,
|
'unit-tests!' => \$opt_ctest,
|
||||||
|
'stress=s' => \$opt_stress,
|
||||||
|
|
||||||
'help|h' => \$opt_usage,
|
'help|h' => \$opt_usage,
|
||||||
# list-options is internal, not listed in help
|
# list-options is internal, not listed in help
|
||||||
@ -1627,6 +1630,22 @@ sub command_line_setup {
|
|||||||
mtr_error("--wait-all can only be used with --start options");
|
mtr_error("--wait-all can only be used with --start options");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# --------------------------------------------------------------------------
|
||||||
|
# Gather stress-test options and modify behavior
|
||||||
|
# --------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if ($opt_stress)
|
||||||
|
{
|
||||||
|
$opt_stress=~ s/,/ /g;
|
||||||
|
$opt_user_args= 1;
|
||||||
|
mtr_error("--stress cannot be combined with named ordinary suites or tests")
|
||||||
|
if $opt_suites || @opt_cases;
|
||||||
|
$opt_suites="stress";
|
||||||
|
@opt_cases= ("wrapper");
|
||||||
|
$ENV{MST_OPTIONS}= $opt_stress;
|
||||||
|
$opt_ctest= 0;
|
||||||
|
}
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
# Check timeout arguments
|
# Check timeout arguments
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
@ -6128,6 +6147,8 @@ Misc options
|
|||||||
nounit-tests Do not run unit tests. Normally run if configured
|
nounit-tests Do not run unit tests. Normally run if configured
|
||||||
and if not running named tests/suites
|
and if not running named tests/suites
|
||||||
unit-tests Run unit tests even if they would otherwise not be run
|
unit-tests Run unit tests even if they would otherwise not be run
|
||||||
|
stress=ARGS Run stress test, providing options to
|
||||||
|
mysql-stress-test.pl. Options are separated by comma.
|
||||||
|
|
||||||
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.
|
||||||
|
29
mysql-test/suite/stress/t/wrapper.test
Normal file
29
mysql-test/suite/stress/t/wrapper.test
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#
|
||||||
|
# This is a wrapper "pseudo" test for mtr --stress execution.
|
||||||
|
# It should not be run directly (will be skipped)
|
||||||
|
# Do not create a result file!
|
||||||
|
#
|
||||||
|
|
||||||
|
if (!$MST_OPTIONS) {
|
||||||
|
skip Only to be run with mtr --stress;
|
||||||
|
}
|
||||||
|
|
||||||
|
# echo Running MST with options $MST_OPTIONS;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
my ($mtest)= split " ", $ENV{MYSQL_TEST};
|
||||||
|
open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/mtest.inc") or die;
|
||||||
|
print FILE "let \$MYSQLTEST_BIN= $mtest;\n";
|
||||||
|
close FILE;
|
||||||
|
EOF
|
||||||
|
|
||||||
|
--source $MYSQL_TMP_DIR/mtest.inc
|
||||||
|
--remove_file $MYSQL_TMP_DIR/mtest.inc
|
||||||
|
|
||||||
|
exec perl mysql-stress-test.pl --mysqltest=$MYSQLTEST_BIN
|
||||||
|
--server-port=$MASTER_MYPORT --server-socket=$MASTER_MYSOCK
|
||||||
|
--server-user=root --cleanup
|
||||||
|
--server-logs-dir=$MYSQLTEST_VARDIR/log
|
||||||
|
--stress-basedir=$MYSQLTEST_VARDIR
|
||||||
|
$MST_OPTIONS
|
||||||
|
;
|
Loading…
x
Reference in New Issue
Block a user