diff options
author | unknown <mkindahl@dl145h.mysql.com> | 2007-07-25 15:40:43 +0200 |
---|---|---|
committer | unknown <mkindahl@dl145h.mysql.com> | 2007-07-25 15:40:43 +0200 |
commit | ef9738fe92e16b74c84b7f071e2cefb7b13b7fdd (patch) | |
tree | 86abdb47243643d4d06ad915695763fe597197c7 /mysql-test/lib | |
parent | b9c18aead4c151a555325462c20121d8c8a654a3 (diff) | |
parent | 6d0e34413d0aee7553b826d4cb5c9c64939ee990 (diff) | |
download | mariadb-git-ef9738fe92e16b74c84b7f071e2cefb7b13b7fdd.tar.gz |
Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1-main
into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-2team
include/my_bitmap.h:
Auto merged
mysql-test/suite/binlog/r/binlog_multi_engine.result:
Auto merged
mysql-test/suite/ndb/r/ndb_binlog_multi.result:
Auto merged
mysql-test/suite/ndb/t/ndb_autodiscover3.test:
Auto merged
mysql-test/suite/ndb/t/ndb_binlog_basic.test:
Auto merged
mysql-test/suite/ndb/t/ndb_binlog_ddl_multi.test:
Auto merged
mysql-test/suite/ndb/t/ndb_binlog_discover.test:
Auto merged
mysql-test/suite/ndb/t/ndb_binlog_ignore_db.test:
Auto merged
mysql-test/suite/ndb/t/ndb_binlog_log_bin.test:
Auto merged
mysql-test/suite/ndb/t/ndb_binlog_multi.test:
Auto merged
mysql-test/suite/ndb/t/ndb_multi_row.test:
Auto merged
mysql-test/suite/rpl/r/rpl_row_log.result:
Auto merged
mysql-test/suite/rpl/r/rpl_row_log_innodb.result:
Auto merged
mysql-test/suite/rpl/r/rpl_stm_log.result:
Auto merged
mysql-test/suite/rpl/r/rpl_truncate_7ndb_2.result:
Auto merged
mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result:
Auto merged
mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_extraCol.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test:
Auto merged
sql/log_event.cc:
Auto merged
mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result:
Manual merge
mysql-test/t/disabled.def:
Manual merge of main tree into replication tree
Diffstat (limited to 'mysql-test/lib')
-rw-r--r-- | mysql-test/lib/mtr_cases.pl | 241 | ||||
-rw-r--r-- | mysql-test/lib/mtr_process.pl | 35 | ||||
-rw-r--r-- | mysql-test/lib/mtr_report.pl | 37 | ||||
-rw-r--r-- | mysql-test/lib/mtr_timer.pl | 9 |
4 files changed, 192 insertions, 130 deletions
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index 120947c84a7..2becb7f9865 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -23,7 +23,8 @@ use IO::File(); use strict; sub collect_test_cases ($); -sub collect_one_test_case ($$$$$$$); +sub collect_one_suite ($$); +sub collect_one_test_case ($$$$$$$$$); sub mtr_options_from_test_file($$); @@ -34,7 +35,120 @@ sub mtr_options_from_test_file($$); ############################################################################## sub collect_test_cases ($) { - my $suite= shift; # Test suite name + my $suites= shift; # Semicolon separated list of test suites + my $cases = []; # Array of hash + + foreach my $suite (split(",", $suites)) + { + collect_one_suite($suite, $cases); + } + + + if ( @::opt_cases ) + { + # Check that the tests specified was found + # in at least one suite + foreach my $tname ( @::opt_cases ) + { + my $found= 0; + foreach my $test ( @$cases ) + { + if ( mtr_match_extension($test->{'name'}, $tname) ) + { + $found= 1; + } + } + if ( not $found ) + { + mtr_error("Could not find $tname in any suite"); + } + } + } + + if ( $::opt_reorder ) + { + # Reorder the test cases in an order that will make them faster to run + my %sort_criteria; + + # Make a mapping of test name to a string that represents how that test + # should be sorted among the other tests. Put the most important criterion + # first, then a sub-criterion, then sub-sub-criterion, et c. + foreach my $tinfo (@$cases) + { + my @criteria = (); + + # Look for tests that muct be in run in a defined order + # that is defined by test having the same name except for + # the ending digit + + # Put variables into hash + my $test_name= $tinfo->{'name'}; + my $depend_on_test_name; + if ( $test_name =~ /^([\D]+)([0-9]{1})$/ ) + { + my $base_name= $1; + my $idx= $2; + mtr_verbose("$test_name => $base_name idx=$idx"); + if ( $idx > 1 ) + { + $idx-= 1; + $base_name= "$base_name$idx"; + mtr_verbose("New basename $base_name"); + } + + foreach my $tinfo2 (@$cases) + { + if ( $tinfo2->{'name'} eq $base_name ) + { + mtr_verbose("found dependent test $tinfo2->{'name'}"); + $depend_on_test_name=$base_name; + } + } + } + + if ( defined $depend_on_test_name ) + { + mtr_verbose("Giving $test_name same critera as $depend_on_test_name"); + $sort_criteria{$test_name} = $sort_criteria{$depend_on_test_name}; + } + else + { + # + # Append the criteria for sorting, in order of importance. + # + push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "1" : "0")); + # Group test with equal options together. + # Ending with "~" makes empty sort later than filled + push(@criteria, join("!", sort @{$tinfo->{'master_opt'}}) . "~"); + + $sort_criteria{$test_name} = join(" ", @criteria); + } + } + + @$cases = sort { + $sort_criteria{$a->{'name'}} . $a->{'name'} cmp + $sort_criteria{$b->{'name'}} . $b->{'name'}; } @$cases; + + if ( $::opt_script_debug ) + { + # For debugging the sort-order + foreach my $tinfo (@$cases) + { + print("$sort_criteria{$tinfo->{'name'}} -> \t$tinfo->{'name'}\n"); + } + } + } + + return $cases; + +} + +sub collect_one_suite($$) +{ + my $suite= shift; # Test suite name + my $cases= shift; # List of test cases + + mtr_verbose("Collecting: $suite"); my $testdir; my $resdir; @@ -50,12 +164,8 @@ sub collect_test_cases ($) { $resdir= "$::glob_mysql_test_dir/suite/$suite/r"; } - my $cases = []; # Array of hash, will be array of C struct - - opendir(TESTDIR, $testdir) or mtr_error("Can't open dir \"$testdir\": $!"); - # ---------------------------------------------------------------------- - # Disable some tests listed in disabled.def + # Build a hash of disabled testcases for this suite # ---------------------------------------------------------------------- my %disabled; if ( open(DISABLED, "$testdir/disabled.def" ) ) @@ -71,11 +181,19 @@ sub collect_test_cases ($) { close DISABLED; } + # Read suite.opt file + my $suite_opt_file= "$testdir/suite.opt"; + my $suite_opts= []; + if ( -f $suite_opt_file ) + { + $suite_opts= mtr_get_opts_from_file($suite_opt_file); + } + if ( @::opt_cases ) { + # Collect in specified order, no sort foreach my $tname ( @::opt_cases ) { - # Run in specified order, no sort my $elem= undef; my $component_id= undef; @@ -122,7 +240,8 @@ sub collect_test_cases ($) { } elsif ( ! $mysqld_test_exists and ! $im_test_exists ) { - mtr_error("Test case $tname is not found"); + # Silently skip, could exist in another suite + next; } elsif ( $mysqld_test_exists ) { @@ -136,13 +255,15 @@ sub collect_test_cases ($) { } } - collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,\%disabled, - $component_id); + collect_one_test_case($testdir,$resdir,$suite,$tname, + $elem,$cases,\%disabled,$component_id, + $suite_opts); } - closedir TESTDIR; } else { + opendir(TESTDIR, $testdir) or mtr_error("Can't open dir \"$testdir\": $!"); + foreach my $elem ( sort readdir(TESTDIR) ) { my $component_id= undef; @@ -165,87 +286,13 @@ sub collect_test_cases ($) { next if $::opt_do_test and ! defined mtr_match_prefix($elem,$::opt_do_test); - collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,\%disabled, - $component_id); + collect_one_test_case($testdir,$resdir,$suite,$tname, + $elem,$cases,\%disabled,$component_id, + $suite_opts); } closedir TESTDIR; } - # Reorder the test cases in an order that will make them faster to run - if ( $::opt_reorder ) - { - - my %sort_criteria; - - # Make a mapping of test name to a string that represents how that test - # should be sorted among the other tests. Put the most important criterion - # first, then a sub-criterion, then sub-sub-criterion, et c. - foreach my $tinfo (@$cases) - { - my @criteria = (); - - # Look for tests that muct be in run in a defined order - # that is defined by test having the same name except for - # the ending digit - - # Put variables into hash - my $test_name= $tinfo->{'name'}; - my $depend_on_test_name; - if ( $test_name =~ /^([\D]+)([0-9]{1})$/ ) - { - my $base_name= $1; - my $idx= $2; - mtr_verbose("$test_name => $base_name idx=$idx"); - if ( $idx > 1 ) - { - $idx-= 1; - $base_name= "$base_name$idx"; - mtr_verbose("New basename $base_name"); - } - - foreach my $tinfo2 (@$cases) - { - if ( $tinfo2->{'name'} eq $base_name ) - { - mtr_verbose("found dependent test $tinfo2->{'name'}"); - $depend_on_test_name=$base_name; - } - } - } - - if ( defined $depend_on_test_name ) - { - mtr_verbose("Giving $test_name same critera as $depend_on_test_name"); - $sort_criteria{$test_name} = $sort_criteria{$depend_on_test_name}; - } - else - { - # - # Append the criteria for sorting, in order of importance. - # - push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "1" : "0")); - # Group test with equal options together. - # Ending with "~" makes empty sort later than filled - push(@criteria, join("!", sort @{$tinfo->{'master_opt'}}) . "~"); - - $sort_criteria{$test_name} = join(" ", @criteria); - } - } - - @$cases = sort { - $sort_criteria{$a->{'name'}} . $a->{'name'} cmp - $sort_criteria{$b->{'name'}} . $b->{'name'}; } @$cases; - - if ( $::opt_script_debug ) - { - # For debugging the sort-order - foreach my $tinfo (@$cases) - { - print("$sort_criteria{$tinfo->{'name'}} -> \t$tinfo->{'name'}\n"); - } - } - } - return $cases; } @@ -257,14 +304,16 @@ sub collect_test_cases ($) { ############################################################################## -sub collect_one_test_case($$$$$$$) { +sub collect_one_test_case($$$$$$$$$) { my $testdir= shift; my $resdir= shift; + my $suite= shift; my $tname= shift; my $elem= shift; my $cases= shift; my $disabled=shift; my $component_id= shift; + my $suite_opts= shift; my $path= "$testdir/$elem"; @@ -279,7 +328,7 @@ sub collect_one_test_case($$$$$$$) { my $tinfo= {}; - $tinfo->{'name'}= $tname; + $tinfo->{'name'}= "$suite.$tname"; $tinfo->{'result_file'}= "$resdir/$tname.result"; $tinfo->{'component_id'} = $component_id; push(@$cases, $tinfo); @@ -334,6 +383,15 @@ sub collect_one_test_case($$$$$$$) { $tinfo->{'slave_opt'}= []; $tinfo->{'slave_mi'}= []; + # Add suite opts + foreach my $opt ( @$suite_opts ) + { + mtr_verbose($opt); + push(@{$tinfo->{'master_opt'}}, $opt); + push(@{$tinfo->{'slave_opt'}}, $opt); + } + + # Add master opts if ( -f $master_opt_file ) { @@ -394,6 +452,7 @@ sub collect_one_test_case($$$$$$$) { } } + # Add slave opts if ( -f $slave_opt_file ) { my $slave_opt= mtr_get_opts_from_file($slave_opt_file); diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index 0c77174e0bd..69026d2c72f 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -142,6 +142,7 @@ sub spawn_impl ($$$$$$$) { if ( $pid ) { + select(STDOUT) if $::glob_win32_perl; return spawn_parent_impl($pid,$mode,$path); } else @@ -163,9 +164,6 @@ sub spawn_impl ($$$$$$$) { { # Don't redirect stdout on ActiveState perl since this is # just another thread in the same process. - # Should be fixed so that the thread that is created with fork - # executes the exe in another process and wait's for it to return. - # In the meanwhile, we get all the output from mysqld's to screen } elsif ( ! open(STDOUT,$log_file_open_mode,$output) ) { @@ -175,7 +173,7 @@ sub spawn_impl ($$$$$$$) { if ( $error ) { - if ( $output eq $error ) + if ( !$::glob_win32_perl and $output eq $error ) { if ( ! open(STDERR,">&STDOUT") ) { @@ -184,15 +182,7 @@ sub spawn_impl ($$$$$$$) { } else { - if ( $::glob_win32_perl ) - { - # Don't redirect stdout on ActiveState perl since this is - # just another thread in the same process. - # Should be fixed so that the thread that is created with fork - # executes the exe in another process and wait's for it to return. - # In the meanwhile, we get all the output from mysqld's to screen - } - elsif ( ! open(STDERR,$log_file_open_mode,$error) ) + if ( ! open(STDERR,$log_file_open_mode,$error) ) { mtr_child_error("can't redirect STDERR to \"$error\": $!"); } @@ -369,7 +359,7 @@ sub mtr_kill_leftovers () { "socket: '$srv->{path_sock}'; ". "port: $srv->{port})"); - my $pid= mtr_mysqladmin_start($srv, "shutdown", 70); + my $pid= mtr_mysqladmin_start($srv, "shutdown", 20); # Save the pid of the mysqladmin process $admin_pids{$pid}= 1; @@ -613,6 +603,11 @@ sub mtr_check_stop_servers ($) { if ( $pid ) { # Server is still alive, put it in list to be hard killed + if ($::glob_win32_perl) + { + # Kill the real process if it's known + $pid= $srv->{'real_pid'} if ($srv->{'real_pid'}); + } $kill_pids{$pid}= 1; # Write a message to the process's error log (if it has one) @@ -666,6 +661,16 @@ sub mtr_check_stop_servers ($) { } } + if ($::glob_win32_perl and $srv->{'real_pid'}) + { + # Wait for the pseudo pid - if the real_pid was known + # the pseudo pid has not been waited for yet, wai blocking + # since it's "such a simple program" + mtr_verbose("Wait for pseudo process $srv->{'pid'}"); + my $ret_pid= waitpid($srv->{'pid'}, 0); + mtr_verbose("Pseudo process $ret_pid died"); + } + $srv->{'pid'}= 0; } } @@ -1043,7 +1048,7 @@ sub sleep_until_file_created ($$$) { { if ( -r $pidfile ) { - return $pid; + return 1; } # Check if it died after the fork() was successful diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index a9d6d17d870..306a0fe5d9d 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -48,30 +48,15 @@ sub mtr_verbose (@); # We can't use diff -u or diff -a as these are not portable sub mtr_show_failed_diff ($) { - my $result_file_name= shift; + my $tinfo= shift; # The reject and log files have been dumped to # to filenames based on the result_file's name - my $tname= basename($result_file_name); - $tname=~ s/\..*$//; - - my $reject_file= "r/$tname.reject"; - my $result_file= "r/$tname.result"; - my $log_file= "$::opt_vardir/log/$tname.log"; - my $eval_file= "r/$tname.eval"; - - if ( $::opt_suite ne "main" ) - { - $reject_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$reject_file"; - $result_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$result_file"; - $eval_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$eval_file"; - $log_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$log_file"; - } - - if ( -f $eval_file ) - { - $result_file= $eval_file; - } + my $base_file= mtr_match_extension($tinfo->{'result_file'}, + "result"); # Trim extension + my $reject_file= "$base_file.reject"; + my $result_file= "$base_file.result"; + my $log_file= "$base_file.log"; my $diffopts= $::opt_udiff ? "-u" : "-c"; @@ -360,6 +345,10 @@ sub mtr_report_stats ($) { /skip-name-resolve mode/ or /slave SQL thread aborted/ or /Slave: .*Duplicate entry/ or + # Special case for Bug #26402 in show_check.test + # Question marks are not valid file name parts + # on Windows platforms. Ignore this error message. + /\QCan't find file: '.\test\????????.frm'\E/ or # Special case, made as specific as possible, for: # Bug #28436: Incorrect position in SHOW BINLOG EVENTS causes # server coredump @@ -369,7 +358,11 @@ sub mtr_report_stats ($) { # Test case for Bug#14233 produces the following warnings: /Stored routine 'test'.'bug14233_1': invalid value in column mysql.proc/ or /Stored routine 'test'.'bug14233_2': invalid value in column mysql.proc/ or - /Stored routine 'test'.'bug14233_3': invalid value in column mysql.proc/ + /Stored routine 'test'.'bug14233_3': invalid value in column mysql.proc/ or + + # BUG#29807 - innodb_mysql.test: Cannot find table test/t2 + # from the internal data dictionary + /Cannot find table test\/bug29807 from the internal data dictionary/ ) { next; # Skip these lines diff --git a/mysql-test/lib/mtr_timer.pl b/mysql-test/lib/mtr_timer.pl index 523799f7cf5..86a9f58514f 100644 --- a/mysql-test/lib/mtr_timer.pl +++ b/mysql-test/lib/mtr_timer.pl @@ -97,9 +97,14 @@ sub mtr_timer_start($$$) { # clearing the signal handler. $SIG{INT}= 'DEFAULT'; + $SIG{TERM}= sub { + mtr_verbose("timer woke up, exiting!"); + exit(0); + }; + $0= "mtr_timer(timers,$name,$duration)"; - mtr_verbose("timer child $name, sleep $duration"); sleep($duration); + mtr_verbose("timer expired after $duration seconds"); exit(0); } } @@ -118,7 +123,7 @@ sub mtr_timer_stop ($$) { # FIXME as Cygwin reuses pids fast, maybe check that is # the expected process somehow?! - kill(9, $tpid); + kill(15, $tpid); # As the timers are so simple programs, we trust them to terminate, # and use blocking wait for it. We wait just to avoid a zombie. |