Commit aadc6d7f authored by Sergei Golubchik's avatar Sergei Golubchik

remove few obscure, unused, or misused mtr features

parent 9a913160
# ==== Purpose ====
#
# Tell mtr that all servers must be restarted after the test has
# finished.
#
# ==== Usage ====
#
# --source include/force_restart.inc
#
# ==== See also ====
#
# include/force_restart_if_skipped.inc
--let $_force_restart_datadir= `SELECT @@datadir`
--append_file $_force_restart_datadir/mtr/force_restart
1
EOF
# ==== Purpose ====
#
# Tell mtr that all servers must be restarted in case the test is
# skipped.
#
# ==== Usage ====
#
# --source include/force_restart_if_skipped.inc
#
# ==== See also ====
#
# include/force_restart.inc
--let $_force_restart_datadir= `SELECT @@datadir`
--append_file $_force_restart_datadir/mtr/force_restart_if_skipped
1
EOF
......@@ -76,12 +76,3 @@ BEGIN
END||
--
-- Procedure used by test case used to force all
-- servers to restart after testcase and thus skipping
-- check test case after test
--
CREATE DEFINER=root@localhost PROCEDURE force_restart()
BEGIN
SELECT 1 INTO OUTFILE 'force_restart';
END||
......@@ -189,13 +189,6 @@ while ($_rpl_server)
# Signal that initialization is done and all connections created.
--let $rpl_inited= 1
# Signal that the server is in a dirty state and needs to be restarted
# if the test is skipped. If the test is not skipped, it will continue
# to the end and execute its cleanup section (and check-testcase will
# report if you forget to clean up).
--source include/force_restart_if_skipped.inc
# Assert that all hosts have different server_ids
if ($rpl_check_server_ids)
{
......
......@@ -34,13 +34,11 @@ our $print_testcases;
our $skip_rpl;
our $do_test;
our $skip_test;
our $skip_combinations;
our $binlog_format;
our $enable_disabled;
our $default_storage_engine;
our $opt_with_ndbcluster_only;
our $defaults_file;
our $quick_collect;
sub collect_option {
my ($opt, $value)= @_;
......@@ -68,9 +66,6 @@ require "mtr_misc.pl";
my $do_test_reg;
my $skip_test_reg;
# If "Quick collect", set to 1 once a test to run has been found.
my $some_test_found;
my $default_suite_object = do 'My/Suite.pm';
sub init_pattern {
......@@ -129,7 +124,6 @@ sub collect_test_cases ($$$$) {
foreach my $suite (split(",", $suites))
{
push(@$cases, collect_one_suite($suite, $opt_cases, $opt_skip_test_list));
last if $some_test_found;
}
}
......@@ -170,7 +164,7 @@ sub collect_test_cases ($$$$) {
}
}
if ( $opt_reorder && !$quick_collect)
if ( $opt_reorder )
{
# Reorder the test cases in an order that will make them faster to run
my %sort_criteria;
......@@ -432,7 +426,6 @@ sub collect_one_suite
# Read combinations for this suite and build testcases x combinations
# if any combinations exists
# ----------------------------------------------------------------------
if ( ! $skip_combinations && ! $quick_collect )
{
my @combinations;
my $combination_file= "$suitedir/combinations";
......@@ -624,12 +617,6 @@ sub optimize_cases {
if ( $default_engine =~ /^ndb/i );
}
}
if ($quick_collect && ! $tinfo->{'skip'})
{
$some_test_found= 1;
return;
}
}
@$cases= @new_cases;
}
......@@ -660,23 +647,6 @@ sub process_opts {
next;
}
$value= mtr_match_prefix($opt, "--result-file=");
if ( defined $value )
{
# Specifies the file mysqltest should compare
# output against
$tinfo->{'result_file'}= "r/$value.result";
next;
}
$value= mtr_match_prefix($opt, "--config-file-template=");
if ( defined $value)
{
# Specifies the configuration file to use for this test
$tinfo->{'template_path'}= dirname($tinfo->{path})."/$value";
next;
}
# If we set default time zone, remove the one we have
$value= mtr_match_prefix($opt, "--default-time-zone=");
if ( defined $value )
......@@ -686,23 +656,6 @@ sub process_opts {
# Fallthrough, add the --default-time-zone option
}
# The --restart option forces a restart even if no special
# option is set. If the options are the same as next testcase
# there is no need to restart after the testcase
# has completed
if ( $opt eq "--force-restart" )
{
$tinfo->{'force_restart'}= 1;
next;
}
$value= mtr_match_prefix($opt, "--testcase-timeout=");
if ( defined $value ) {
# Overrides test case timeout for this test
$tinfo->{'case-timeout'}= $value;
next;
}
# Ok, this was a real option, add it
push(@{$tinfo->{$opt_name}}, $opt);
}
......@@ -874,13 +827,6 @@ sub collect_one_test_case {
}
}
# ----------------------------------------------------------------------
# <tname>.slave-mi
# ----------------------------------------------------------------------
mtr_error("$tname: slave-mi not supported anymore")
if ( -f "$testdir/$tname.slave-mi");
my ($master_opts, $slave_opts)=
tags_from_test_file($tinfo, "$testdir/${tname}.test", $suitedir);
......@@ -907,6 +853,7 @@ sub collect_one_test_case {
$tinfo->{'comment'}= "Test needs --big-test";
return $tinfo
}
if ( $tinfo->{'big_test'} )
{
# All 'big_test' takes a long time to run
......@@ -920,13 +867,6 @@ sub collect_one_test_case {
return $tinfo
}
if ( $tinfo->{'need_debug'} && ! $::debug_compiled_binaries )
{
$tinfo->{'skip'}= 1;
$tinfo->{'comment'}= "Test needs debug binaries";
return $tinfo
}
if ( $tinfo->{'ndb_test'} )
{
# This is a NDB test
......
......@@ -4039,27 +4039,6 @@ sub find_analyze_request
}
# The test can leave a file in var/tmp/ to signal
# that all servers should be restarted
sub restart_forced_by_test($)
{
my $file = shift;
my $restart = 0;
foreach my $mysqld ( mysqlds() )
{
my $datadir = $mysqld->value('datadir');
my $force_restart_file = "$datadir/mtr/$file";
if ( -f $force_restart_file )
{
mtr_verbose("Restart of servers forced by test");
$restart = 1;
last;
}
}
return $restart;
}
# Return timezone value of tinfo or default value
sub timezone {
my ($tinfo)= @_;
......@@ -4403,11 +4382,7 @@ sub run_testcase ($$) {
if ( $res == 0 )
{
my $check_res;
if ( restart_forced_by_test('force_restart') )
{
stop_all_servers($opt_shutdown_timeout);
}
elsif ( $opt_check_testcases and
if ( $opt_check_testcases and
$check_res= check_testcase($tinfo, "after"))
{
if ($check_res == 1) {
......@@ -4443,8 +4418,7 @@ sub run_testcase ($$) {
find_testcase_skipped_reason($tinfo);
mtr_report_test_skipped($tinfo);
# Restart if skipped due to missing perl, it may have had side effects
if ( restart_forced_by_test('force_restart_if_skipped') ||
$tinfo->{'comment'} =~ /^perl not found/ )
if ( $tinfo->{'comment'} =~ /^perl not found/ )
{
stop_all_servers($opt_shutdown_timeout);
}
......@@ -6446,7 +6420,7 @@ Options for debugging the product
max-save-datadir Limit the number of datadir saved (to avoid filling
up disks for heavily crashing server). Defaults to
$opt_max_save_datadir, set to 0 for no limit. Set
it's default with MTR_MAX_SAVE_DATDIR
it's default with MTR_MAX_SAVE_DATADIR
max-test-fail Limit the number of test failurs before aborting
the current test run. Defaults to
$opt_max_test_fail, set to 0 for no limit. Set
......
......@@ -4,7 +4,6 @@ SELECT * INTO @Y FROM init_file.startup limit 1,1;
SELECT YEAR(@X)-YEAR(@Y);
YEAR(@X)-YEAR(@Y)
0
DROP DATABASE init_file;
ok
end of 4.1 tests
select * from t1;
......@@ -20,4 +19,3 @@ y
3
11
13
drop table t1, t2;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
--force-restart --skip-stack-trace --log-warnings=0 --log-bin=master-bin --log-bin-index=master-bin
--skip-stack-trace --log-warnings=0 --log-bin=master-bin --log-bin-index=master-bin
--max_binlog_size=4096 --default-storage-engine=MyISAM
--force-restart
#
# few innodb tests depend on innodb tablespace being completelty clean and new
#
# this file deletes old innodb files and restarts mysqld
#
let $_server_id= `SELECT @@server_id`;
let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect;
let $datadir= `SELECT @@datadir`;
exec echo "wait" > $_expect_file_name;
shutdown_server 10; # give it 10 seconds to die
remove_file $datadir/ib_logfile0;
remove_file $datadir/ib_logfile1;
remove_file $datadir/ibdata1;
exec echo "restart" > $_expect_file_name;
enable_reconnect;
source include/wait_until_connected_again.inc;
disable_reconnect;
......@@ -3,6 +3,7 @@
# originally "innodb_file_format_check") with a user-Defined Variable.
--source include/not_embedded.inc
--source suite/innodb/include/restart_and_reinit.inc
# Save the value (Antelope) in 'innodb_file_format_max' to
# 'old_innodb_file_format_max'
......
-- source include/not_embedded.inc
--source suite/innodb/include/restart_and_reinit.inc
let $innodb_file_format_orig=`select @@innodb_file_format`;
......
......@@ -45,4 +45,3 @@ delete from mysql.user where user="replicate";
# End of 4.1 tests
--source include/rpl_end.inc
--source include/force_restart.inc
--replicate-same-server-id --relay-log=slave-relay-bin
--force-restart
......@@ -17,7 +17,9 @@ reset master;
connection slave;
set @restore_slave_net_timeout= @@global.slave_net_timeout;
--disable_warnings
set @@global.slave_net_timeout= 10;
--enable_warnings
###
### Checking the range
......
......@@ -183,4 +183,3 @@ DROP TABLE t5;
sync_slave_with_master;
--source include/rpl_end.inc
--source include/force_restart.inc
......@@ -10,8 +10,8 @@
##########
# Includes
-- source include/master-slave.inc
-- source include/have_binlog_format_mixed_or_row.inc
-- source include/master-slave.inc
-- source extra/rpl_tests/rpl_loadfile.test
......
......@@ -9,12 +9,13 @@
-- source include/have_binlog_format_row.inc
# Embedded server doesn't support binlogging
-- source include/not_embedded.inc
-- source include/master-slave.inc
# This test requires the cp932 charset compiled in
-- source include/have_cp932.inc
# Slow test, don't run during staging part
-- source include/not_staging.inc
-- source include/master-slave.inc
# Setup Section
# we need this for getting fixed timestamps inside of this test
......
......@@ -3,9 +3,9 @@
# The test verifies that SHOW STATUS LIKE 'Slave_running' displays ON
# if and only if `SHOW SLAVE STATUS' displays YES for Slave_IO_Running and Slave_SQL_Running
#
source include/master-slave.inc;
source include/have_debug.inc;
source include/have_debug_sync.inc;
source include/master-slave.inc;
connection slave;
......
......@@ -75,4 +75,3 @@ connection master;
DROP TABLE t1;
--source include/rpl_end.inc
--source include/force_restart.inc
--force-restart --log-slow-slave-statements --log-slow-queries
--log-slow-slave-statements --log-slow-queries
# File for specialities regarding replication from or to InnoDB
# tables.
source include/master-slave.inc;
source include/have_innodb.inc;
source include/have_binlog_format_mixed_or_statement.inc;
source include/master-slave.inc;
source extra/rpl_tests/rpl_innodb.test;
--source include/rpl_end.inc
......@@ -12,8 +12,8 @@
# This test issues SHOW [BINLOG|RELAYLOG] EVENTS both on master and slave after
# some statements have been issued.
-- source include/master-slave.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/master-slave.inc
-- source extra/rpl_tests/rpl_show_relaylog_events.inc
--source include/rpl_end.inc
......@@ -10,6 +10,7 @@
-- source include/not_ndb_default.inc
-- source include/have_binlog_format_mixed_or_row.inc
-- source include/master-slave.inc
# Since this test generates row-based events in the binary log, the
......@@ -18,7 +19,6 @@
# BINLOG_FORMAT.
connection slave;
-- source include/have_binlog_format_mixed_or_row.inc
connection master;
--disable_warnings
......
--loose-debug-dbug="+d,all_errors_are_temporary_errors" --slave-transaction-retries=2
--force-restart
......@@ -60,8 +60,8 @@
# actually can be replicated safely in statement mode.
source include/master-slave.inc;
source include/have_binlog_format_mixed_or_row.inc;
source include/master-slave.inc;
--echo ==== Initialization ====
......
......@@ -13,8 +13,6 @@ INSERT INTO init_file.startup VALUES ( NOW() );
SELECT * INTO @X FROM init_file.startup limit 0,1;
SELECT * INTO @Y FROM init_file.startup limit 1,1;
SELECT YEAR(@X)-YEAR(@Y);
# Enable this DROP DATABASE only after resolving bug #42507
DROP DATABASE init_file;
--echo ok
--echo end of 4.1 tests
......@@ -27,10 +25,13 @@ select * from t1;
# Expected:
# 30, 3, 11, 13
select * from t2;
# Enable this DROP TABLE only after resolving bug #42507
drop table t1, t2;
# MTR will restart server anyway, but by forcing it we avoid being warned
# about the apparent side effect
#
# we don't drop tables (t1, t2) and databases (init_file)
# created by init-file script, because they existed when before-test
# check was run, and if they won't exist after the test, after-test check
# will complain.
# But it's safe to keep them, because mysqld will be restarted after the
# test (--init-file option) and datadir will be reinitialized.
#
--source include/force_restart.inc
--key_buffer_size=2M --small.key_buffer_size=256K --small.key_buffer_size=128K
--force-restart
--max-binlog-size=4096
--force-restart
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