Below is the list of changes that have just been committed into a local
5.0 repository of jimw. When jimw does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2087 06/04/20 19:52:04 jimw@stripped +2 -0
Bug #19083 ./mysql-test-run.pl starts NDB when it is not needed
Now NDB is only initialized and started when the tests that are
being run will make use of it. The same thing is also done for the
slave databases and the instance manager.
mysql-test/mysql-test-run.pl
1.88 06/04/20 19:52:00 jimw@stripped +52 -32
Only initialize (and start) NDB, the instance manager, and the slaves
when we have tests that require them.
mysql-test/ndb/ndbcluster.sh
1.44 06/04/20 19:37:53 jimw@stripped +2 -2
Fix text message that has always annoyed me
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jimw
# Host: rama.(none)
# Root: /home/jimw/my/mysql-5.0-19083
--- 1.87/mysql-test/mysql-test-run.pl 2006-04-11 00:09:15 -07:00
+++ 1.88/mysql-test/mysql-test-run.pl 2006-04-20 19:52:00 -07:00
@@ -343,7 +343,7 @@
sub ndbcluster_start ($);
sub ndbcluster_stop ();
sub run_benchmarks ($);
-sub run_tests ();
+sub initialize_servers ();
sub mysql_install_db ();
sub install_db ($$);
sub run_testcase ($);
@@ -374,7 +374,7 @@
command_line_setup();
executable_setup();
- check_ndbcluster_support();
+ check_ndbcluster_support(); # We check whether to actually use it later
check_ssl_support();
environment_setup();
@@ -389,24 +389,7 @@
{
gprof_prepare();
}
-
- if ( ! $glob_use_running_server )
- {
- if ( $opt_start_dirty )
- {
- kill_running_server();
- }
- else
- {
- kill_and_cleanup();
- mysql_install_db();
- if ( $opt_force )
- {
- save_installed_db();
- }
- }
- }
-
+
if ( $opt_start_dirty )
{
if ( ndbcluster_start($opt_with_ndbcluster) )
@@ -424,15 +407,34 @@
}
elsif ( $opt_bench )
{
+ initialize_servers();
run_benchmarks(shift); # Shift what? Extra arguments?!
}
elsif ( $opt_stress )
{
+ initialize_servers();
run_stress_test()
}
else
{
- run_tests();
+ # Figure out which tests we are going to run
+ my $tests= collect_test_cases($opt_suite);
+
+ # Turn off NDB and other similar options if no tests use it
+ my ($need_ndbcluster,$need_im,$need_slave);
+ foreach my $test (@$tests)
+ {
+ $need_ndbcluster||= $test->{ndb_test};
+ $need_im||= $test->{component_id} eq 'im';
+ $need_slave||= $test->{slave_num};
+ }
+ $opt_with_ndbcluster= 0 unless $need_ndbcluster;
+ $opt_skip_im= 1 unless $need_im;
+ $opt_skip_rpl= 1 unless $need_slave;
+
+ initialize_servers();
+
+ run_suite($opt_suite, $tests);
}
mtr_exit(0);
@@ -1388,7 +1390,7 @@
if ($opt_with_ndbcluster)
{
- mtr_report("Using ndbcluster");
+ mtr_report("Using ndbcluster if necessary");
return;
}
@@ -1404,7 +1406,7 @@
$opt_with_ndbcluster= 0;
return;
}
- mtr_report("Using ndbcluster, mysqld supports it");
+ mtr_report("Using ndbcluster if necessary, mysqld supports it");
$opt_with_ndbcluster= 1;
return;
}
@@ -1561,12 +1563,9 @@
# FIXME how to specify several suites to run? Comma separated list?
-sub run_tests () {
- run_suite($opt_suite);
-}
sub run_suite () {
- my $suite= shift;
+ my ($suite, $tests)= @_;
mtr_print_thick_line();
@@ -1574,8 +1573,6 @@
mtr_timer_start($glob_timers,"suite", 60 * $opt_suite_timeout);
- my $tests= collect_test_cases($suite);
-
mtr_report("Starting Tests in the '$suite' suite");
mtr_print_header();
@@ -1617,14 +1614,37 @@
#
##############################################################################
+sub initialize_servers () {
+ if ( ! $glob_use_running_server )
+ {
+ if ( $opt_start_dirty )
+ {
+ kill_running_server();
+ }
+ else
+ {
+ kill_and_cleanup();
+ mysql_install_db();
+ if ( $opt_force )
+ {
+ save_installed_db();
+ }
+ }
+ }
+}
+
sub mysql_install_db () {
# FIXME not exactly true I think, needs improvements
install_db('master', $master->[0]->{'path_myddir'});
install_db('master', $master->[1]->{'path_myddir'});
- install_db('slave', $slave->[0]->{'path_myddir'});
- install_db('slave', $slave->[1]->{'path_myddir'});
- install_db('slave', $slave->[2]->{'path_myddir'});
+
+ if ( ! $opt_skip_rpl )
+ {
+ install_db('slave', $slave->[0]->{'path_myddir'});
+ install_db('slave', $slave->[1]->{'path_myddir'});
+ install_db('slave', $slave->[2]->{'path_myddir'});
+ }
if ( ! $opt_skip_im )
{
--- 1.43/mysql-test/ndb/ndbcluster.sh 2006-01-21 06:39:32 -08:00
+++ 1.44/mysql-test/ndb/ndbcluster.sh 2006-04-20 19:37:53 -07:00
@@ -232,8 +232,8 @@
# test if Ndb Cluster starts properly
-echo "Waiting for started..."
-if ( $exec_waiter ) | grep "NDBT_ProgramExit: 0 - OK"; then :; else
+echo "Waiting for NDB data nodes to start..."
+if ( $exec_waiter ) | grep -q "NDBT_ProgramExit: 0 - OK"; then :; else
echo "Ndbcluster startup failed"
stop_default_ndbcluster
exit 1
| Thread |
|---|
| • bk commit into 5.0 tree (jimw:1.2087) BUG#19083 | Jim Winstead | 21 Apr |