Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
ade1b6ce
Commit
ade1b6ce
authored
Jun 11, 2006
by
msvensson@neptunus.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prepare for selective restart of slaves
Add comment why test is skipped
parent
82103ed9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
147 additions
and
78 deletions
+147
-78
mysql-test/lib/mtr_cases.pl
mysql-test/lib/mtr_cases.pl
+16
-22
mysql-test/lib/mtr_report.pl
mysql-test/lib/mtr_report.pl
+1
-1
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+130
-55
No files found.
mysql-test/lib/mtr_cases.pl
View file @
ade1b6ce
...
...
@@ -243,26 +243,22 @@ sub collect_one_test_case($$$$$$$) {
if
(
$::opt_skip_rpl
)
{
$tinfo
->
{'
skip
'}
=
1
;
$tinfo
->
{'
comment
'}
=
"
No replication tests(--skip-rpl)
";
return
;
}
$tinfo
->
{'
slave_num
'}
=
1
;
# Default, use one slave
# FIXME currently we always restart slaves
$tinfo
->
{'
slave_restart
'}
=
1
;
if
(
$tname
eq
'
rpl_failsafe
'
or
$tname
eq
'
rpl_chain_temp_table
'
)
{
#
$tinfo->{'slave_num'}= 3; # Not 3 ? Check old code, strange
#
$tinfo->{'slave_num'}= 3; # Not 3 ? Check old code, strange
}
}
if
(
defined
mtr_match_prefix
(
$tname
,"
federated
")
)
{
$tinfo
->
{'
slave_num
'}
=
1
;
# Default, use one slave
# FIXME currently we always restart slaves
$tinfo
->
{'
slave_restart
'}
=
1
;
# Default, federated uses the first slave as it's federated database
$tinfo
->
{'
slave_num
'}
=
1
;
}
if
(
$::opt_with_ndbcluster_all
or
defined
mtr_match_substring
(
$tname
,"
ndb
")
)
...
...
@@ -273,12 +269,14 @@ sub collect_one_test_case($$$$$$$) {
{
# All ndb test's should be skipped
$tinfo
->
{'
skip
'}
=
1
;
$tinfo
->
{'
comment
'}
=
"
No ndbcluster test(--skip-ndbcluster)
";
return
;
}
if
(
!
$::opt_with_ndbcluster
)
{
# Ndb is not supported, skip them
$tinfo
->
{'
skip
'}
=
1
;
$tinfo
->
{'
comment
'}
=
"
No ndbcluster support
";
return
;
}
}
...
...
@@ -383,6 +381,7 @@ sub collect_one_test_case($$$$$$$) {
if
(
$::glob_win32_perl
)
{
$tinfo
->
{'
skip
'}
=
1
;
$tinfo
->
{'
comment
'}
=
"
No tests with sh scripts on Windows
";
}
else
{
...
...
@@ -396,6 +395,7 @@ sub collect_one_test_case($$$$$$$) {
if
(
$::glob_win32_perl
)
{
$tinfo
->
{'
skip
'}
=
1
;
$tinfo
->
{'
comment
'}
=
"
No tests with sh scripts on Windows
";
}
else
{
...
...
@@ -433,26 +433,17 @@ sub collect_one_test_case($$$$$$$) {
if
(
$::glob_use_embedded_server
)
{
$tinfo
->
{'
skip
'}
=
1
;
mtr_report
(
"
Instance Manager tests are not available in embedded mode.
"
.
"
Test case '
$tname
' is skipped.
");
$tinfo
->
{'
comment
'}
=
"
No IM with embedded server
";
}
elsif
(
$::opt_ps_protocol
)
{
$tinfo
->
{'
skip
'}
=
1
;
mtr_report
(
"
Instance Manager tests are not run with --ps-protocol.
"
.
"
Test case '
$tname
' is skipped.
");
$tinfo
->
{'
comment
'}
=
"
No IM with --ps-protocol
";
}
elsif
(
$::opt_skip_im
)
{
$tinfo
->
{'
skip
'}
=
1
;
mtr_report
(
"
Instance Manager executable is unavailable.
"
.
"
Test case '
$tname
' is skipped.
");
$tinfo
->
{'
comment
'}
=
"
No IM support avaliable
";
}
}
else
...
...
@@ -461,8 +452,10 @@ sub collect_one_test_case($$$$$$$) {
if
(
!
$tinfo
->
{'
innodb_test
'}
)
{
# mtr_report("Adding '--skip-innodb' to $tinfo->{'name'}");
push
(
@
{
$tinfo
->
{'
master_opt
'}},
"
--skip-innodb
");
# mtr_verbose("Adding '--skip-innodb' to $tinfo->{'name'}");
# FIXME activate the --skip-innodb only when running with
# selected test cases
# push(@{$tinfo->{'master_opt'}}, "--skip-innodb");
}
}
...
...
@@ -472,6 +465,7 @@ sub collect_one_test_case($$$$$$$) {
(
$tinfo
->
{'
master_restart
'}
or
$tinfo
->
{'
slave_restart
'}
)
)
{
$tinfo
->
{'
skip
'}
=
1
;
$tinfo
->
{'
comment
'}
=
"
Can't restart a running server
";
}
}
...
...
mysql-test/lib/mtr_report.pl
View file @
ade1b6ce
...
...
@@ -97,7 +97,7 @@ sub mtr_report_test_skipped ($) {
}
else
{
print
"
[ skipped ]
\n
";
print
"
[ skipped ]
$tinfo
->{'comment'}
\n
";
}
}
...
...
mysql-test/mysql-test-run.pl
View file @
ade1b6ce
...
...
@@ -900,7 +900,7 @@ sub command_line_setup () {
port
=>
$opt_master_myport
,
start_timeout
=>
400
,
# enough time create innodb tables
cluster
=>
0
,
# index in clusters list
master_opt
=>
[]
,
start_opts
=>
[]
,
};
$master
->
[
1
]
=
...
...
@@ -915,6 +915,7 @@ sub command_line_setup () {
port
=>
$opt_master_myport
+
1
,
start_timeout
=>
400
,
# enough time create innodb tables
cluster
=>
0
,
# index in clusters list
start_opts
=>
[]
,
};
$slave
->
[
0
]
=
...
...
@@ -930,6 +931,7 @@ sub command_line_setup () {
start_timeout
=>
400
,
cluster
=>
1
,
# index in clusters list
start_opts
=>
[]
,
};
$slave
->
[
1
]
=
...
...
@@ -944,6 +946,7 @@ sub command_line_setup () {
port
=>
$opt_slave_myport
+
1
,
start_timeout
=>
300
,
cluster
=>
-
1
,
# index in clusters list
start_opts
=>
[]
,
};
$slave
->
[
2
]
=
...
...
@@ -958,6 +961,7 @@ sub command_line_setup () {
port
=>
$opt_slave_myport
+
2
,
start_timeout
=>
300
,
cluster
=>
-
1
,
# index in clusters list
start_opts
=>
[]
,
};
$instance_manager
=
...
...
@@ -2262,6 +2266,8 @@ sub run_testcase ($) {
elsif
(
$res
==
62
)
{
# Testcase itself tell us to skip this one
# FIXME get reason to skip from mysqltest
$tinfo
->
{'
comment
'}
=
"
Detected by testcase
";
mtr_report_test_skipped
(
$tinfo
);
}
elsif
(
$res
==
63
)
...
...
@@ -2361,7 +2367,6 @@ sub restore_installed_db ($) {
{
foreach
my
$ndbd
(
@
{
$cluster
->
{'
ndbds
'}})
{
mtr_verbose
("
$ndbd
->{'path_fs'}
"
);
rmtree
("
$ndbd
->{'path_fs'}
"
);
}
}
...
...
@@ -2373,7 +2378,6 @@ sub restore_installed_db ($) {
}
}
sub
report_failure_and_restart
($)
{
my
$tinfo
=
shift
;
...
...
@@ -2831,6 +2835,10 @@ sub mysqld_start ($$$) {
# Remember pid of the started process
$mysqld
->
{'
pid
'}
=
$pid
;
# Remember options used when starting
$mysqld
->
{'
start_opts
'}
=
$extra_opt
;
mtr_verbose
("
mysqld pid:
$pid
");
return
$pid
;
}
...
...
@@ -2930,27 +2938,27 @@ sub run_testcase_stop_servers($) {
return
;
}
# We try to find out if we are to restart the
server
# We try to find out if we are to restart the
master(s)
my
$do_restart
=
0
;
# Assumes we don't have to
if
(
$tinfo
->
{'
master_sh
'}
)
{
$do_restart
=
1
;
# Always restart if script to run
mtr_
report
("
Restart because: Always restart if script to run
");
mtr_
verbose
("
Restart because: Always restart if script to run
");
}
elsif
(
$opt_with_ndbcluster
and
$tinfo
->
{'
ndb_test
'}
==
0
and
$clusters
->
[
0
]
->
{'
pid
'}
!=
0
)
{
$do_restart
=
1
;
# Restart without cluster
mtr_
report
("
Restart because: Test does not need cluster
");
mtr_
verbose
("
Restart because: Test does not need cluster
");
}
elsif
(
$opt_with_ndbcluster
and
$tinfo
->
{'
ndb_test
'}
==
1
and
$clusters
->
[
0
]
->
{'
pid
'}
==
0
)
{
$do_restart
=
1
;
# Restart with cluster
mtr_
report
("
Restart because: Test need cluster
");
mtr_
verbose
("
Restart because: Test need cluster
");
}
elsif
(
$master
->
[
0
]
->
{'
running_master_is_special
'}
and
$master
->
[
0
]
->
{'
running_master_is_special
'}
->
{'
timezone
'}
eq
...
...
@@ -2959,24 +2967,30 @@ sub run_testcase_stop_servers($) {
$tinfo
->
{'
master_opt
'})
)
{
# If running master was started with special settings, but
# the current test requ
u
ires the same ones, we *don't* restart.
# the current test requires the same ones, we *don't* restart.
$do_restart
=
0
;
mtr_
report
("
Skip restart: options are equal
"
.
mtr_
verbose
("
Skip restart: options are equal
"
.
join
("
",
@
{
$tinfo
->
{'
master_opt
'}}));
}
elsif
(
$tinfo
->
{'
master_restart
'}
or
$master
->
[
0
]
->
{'
running_master_is_special
'}
)
elsif
(
$tinfo
->
{'
master_restart
'}
)
{
$do_restart
=
1
;
mtr_report
("
Restart because: master_restart or running_master_is_special
");
mtr_verbose
("
Restart because: master_restart
");
}
elsif
(
$master
->
[
0
]
->
{'
running_master_is_special
'}
)
{
$do_restart
=
1
;
mtr_verbose
("
Restart because: running_master_is_special
");
}
# Check that running master was started with same options
# as the current test requires
elsif
(
!
mtr_same_opts
(
$master
->
[
0
]
->
{'
master_opt
'},
elsif
(
!
mtr_same_opts
(
$master
->
[
0
]
->
{'
start_opts
'},
$tinfo
->
{'
master_opt
'})
)
{
$do_restart
=
1
;
mtr_report
("
Restart because: running with different options
");
mtr_verbose
("
Restart because: running with different options '
"
.
join
("
",
@
{
$tinfo
->
{'
master_opt
'}})
.
"
' != '
"
.
join
("
",
@
{
$master
->
[
0
]
->
{'
start_opts
'}})
.
"
'
"
);
}
my
$pid
;
...
...
@@ -3036,12 +3050,65 @@ sub run_testcase_stop_servers($) {
}
}
# ----------------------------------------------------------------------
# Always terminate all slaves, if any. Else we may have useless
# reconnection attempts and error messages in case the slave and
# master servers restart.
# ----------------------------------------------------------------------
# We try to find out if we are to restart the slaves
my
$do_slave_restart
=
0
;
# Assumes we don't have to
# FIXME only restaret when necessary
$do_slave_restart
=
1
;
# if ( ! $slave->[0]->{'pid'} )
# {
# # mtr_verbose("Slave not started, no need to check slave restart");
# }
# elsif ( $do_restart )
# {
# $do_slave_restart= 1; # Always restart if master restart
# mtr_verbose("Restart slave because: Master restart");
# }
# elsif ( $tinfo->{'slave_sh'} )
# {
# $do_slave_restart= 1; # Always restart if script to run
# mtr_verbose("Restart slave because: Always restart if script to run");
# }
# elsif ( $opt_with_ndbcluster and
# $tinfo->{'ndb_test'} == 0 and
# $clusters->[1]->{'pid'} != 0 )
# {
# $do_slave_restart= 1; # Restart without slave cluster
# mtr_verbose("Restart slave because: Test does not need slave cluster");
# }
# elsif ( $opt_with_ndbcluster and
# $tinfo->{'ndb_test'} == 1 and
# $clusters->[1]->{'pid'} == 0 )
# {
# $do_slave_restart= 1; # Restart with slave cluster
# mtr_verbose("Restart slave because: Test need slave cluster");
# }
# elsif ( $tinfo->{'slave_restart'} )
# {
# $do_slave_restart= 1;
# mtr_verbose("Restart slave because: slave_restart");
# }
# elsif ( $slave->[0]->{'running_slave_is_special'} )
# {
# $do_slave_restart= 1;
# mtr_verbose("Restart slave because: running_slave_is_special");
# }
# # Check that running slave was started with same options
# # as the current test requires
# elsif (! mtr_same_opts($slave->[0]->{'start_opts'},
# $tinfo->{'slave_opt'}) )
# {
# $do_slave_restart= 1;
# mtr_verbose("Restart slave because: running with different options '" .
# join(" ", @{$tinfo->{'slave_opt'}}) . "' != '" .
# join(" ", @{$slave->[0]->{'start_opts'}}) . "'" );
# }
if
(
$do_slave_restart
)
{
delete
$slave
->
[
0
]
->
{'
running_slave_is_special
'};
# Forget history
# Start shutdown of all started slaves
foreach
my
$mysqld
(
@
{
$slave
})
...
...
@@ -3088,6 +3155,7 @@ sub run_testcase_stop_servers($) {
$ndbd
->
{'
pid
'}
=
0
;
# Assume we are done with it
}
}
}
# ----------------------------------------------------------------------
# Shutdown has now been started and lists for the shutdown processes
...
...
@@ -3138,13 +3206,12 @@ sub run_testcase_start_servers($) {
mysqld_start
(
$master
->
[
0
],
$tinfo
->
{'
master_opt
'},
[]
);
# Remember options used to start
$master
->
[
0
]
->
{'
master_opt
'}
=
$tinfo
->
{'
master_opt
'};
}
if
(
$clusters
->
[
0
]
->
{'
pid
'}
and
!
$master
->
[
1
]
->
{'
pid
'}
)
{
# Test needs cluster, start an extra mysqld connected to cluster
# First wait for first mysql server to have created ndb system tables ok
# FIXME This is a workaround so that only one mysqld creates the tables
if
(
!
sleep_until_file_created
(
...
...
@@ -3202,8 +3269,16 @@ sub run_testcase_start_servers($) {
{
mysqld_start
(
$slave
->
[
$idx
],
$tinfo
->
{'
slave_opt
'},
$tinfo
->
{'
slave_mi
'});
}
}
if
(
$tinfo
->
{'
slave_restart
'}
)
{
# Save this test case information, so next can examine it
$slave
->
[
0
]
->
{'
running_slave_is_special
'}
=
$tinfo
;
}
}
# Wait for clusters to start
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment