mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Start cluster only for testcases that really needs it and stop it when
not needed by the tescases. This will save test time for those testcases that does not need cluster, but need a restart, as they dont have to wait the extra time it would take for cluster to restart. It will also save time for other testcases, as cluster does not need to be contacted for each table to be dropped or created. Backport from 5.1 mysql-test/lib/mtr_cases.pl: Mark all test cases where name contains "ndb" as ndbcluster needed mysql-test/lib/mtr_match.pl: Add mtr_match_substring function mysql-test/lib/mtr_stress.pl: Extre param to mysqld_start mysql-test/mysql-test-run.pl: Only start ndbcluster for testcases that needs it.
This commit is contained in:
@@ -252,6 +252,26 @@ sub collect_one_test_case($$$$$$$) {
|
||||
$tinfo->{'slave_restart'}= 1;
|
||||
}
|
||||
|
||||
# Cluster is needed by test case if testname contains ndb
|
||||
if ( ( $::opt_with_ndbcluster or $::glob_use_running_ndbcluster ) and
|
||||
defined mtr_match_substring($tname,"ndb") )
|
||||
{
|
||||
if ( $::opt_skip_ndbcluster )
|
||||
{
|
||||
$tinfo->{'ndb_test'}= 0;
|
||||
$tinfo->{'skip'}= 1;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$tinfo->{'ndb_test'}= 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$tinfo->{'ndb_test'}= 0;
|
||||
}
|
||||
|
||||
# FIXME what about embedded_server + ndbcluster, skip ?!
|
||||
|
||||
my $master_opt_file= "$testdir/$tname-master.opt";
|
||||
|
||||
@@ -50,6 +50,23 @@ sub mtr_match_extension ($$) {
|
||||
}
|
||||
|
||||
|
||||
# Match a substring anywere in a string
|
||||
|
||||
sub mtr_match_substring ($$) {
|
||||
my $string= shift;
|
||||
my $substring= shift;
|
||||
|
||||
if ( $string =~ /(.*)\Q$substring\E(.*)$/ ) # strncmp
|
||||
{
|
||||
return $1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return undef; # NULL
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub mtr_match_any_exact ($$) {
|
||||
my $string= shift;
|
||||
my $mlist= shift;
|
||||
|
||||
@@ -28,7 +28,7 @@ sub run_stress_test ()
|
||||
|
||||
if ( ! $::glob_use_embedded_server and ! $::opt_local_master )
|
||||
{
|
||||
$::master->[0]->{'pid'}= mysqld_start('master',0,[],[]);
|
||||
$::master->[0]->{'pid'}= mysqld_start('master',0,[],[],0);
|
||||
if ( ! $::master->[0]->{'pid'} )
|
||||
{
|
||||
mtr_error("Can't start the mysqld server");
|
||||
|
||||
Reference in New Issue
Block a user