diff options
Diffstat (limited to 'mysql-test/mysql-test-run.pl')
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 430 |
1 files changed, 260 insertions, 170 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 1f332dfd82f..2fab95fc1ec 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -174,16 +174,17 @@ my @DEFAULT_SUITES= qw( handler- heap- innodb- + innodb_fts- innodb_zip- maria- + multi_source- optimizer_unfixed_bugs- - oqgraph- parts- percona- perfschema- plugins- + roles- rpl- - sphinx- sys_vars- unit- vcol- @@ -209,6 +210,8 @@ our @opt_mysqld_envs; my $opt_stress; +my $opt_dry_run; + my $opt_compress; my $opt_ssl; my $opt_skip_ssl; @@ -349,11 +352,12 @@ my $exe_ndb_mgm; our %mysqld_variables; our @optional_plugins; -my $source_dist= 0; +my $source_dist= -d "../sql"; my $opt_max_save_core= env_or_val(MTR_MAX_SAVE_CORE => 5); my $opt_max_save_datadir= env_or_val(MTR_MAX_SAVE_DATADIR => 20); my $opt_max_test_fail= env_or_val(MTR_MAX_TEST_FAIL => 10); +my $opt_core_on_failure= 0; my $opt_parallel= $ENV{MTR_PARALLEL} || 1; @@ -395,11 +399,6 @@ sub main { executable_setup(); - if (!$opt_suites) { - $opt_suites= join ',', collect_default_suites(@DEFAULT_SUITES); - } - mtr_report("Using suites: $opt_suites") unless @opt_cases; - # --debug[-common] implies we run debug server $opt_debug_server= 1 if $opt_debug || $opt_debug_common; @@ -412,16 +411,30 @@ sub main { { # Run the mysqld to find out what features are available collect_mysqld_features(); - mysql_install_db(default_mysqld(), "$opt_vardir/install.db"); } check_ndbcluster_support(); check_ssl_support(); check_debug_support(); + if (!$opt_suites) { + $opt_suites= join ',', collect_default_suites(@DEFAULT_SUITES); + } + mtr_report("Using suites: $opt_suites") unless @opt_cases; + mtr_report("Collecting tests..."); my $tests= collect_test_cases($opt_reorder, $opt_suites, \@opt_cases, \@opt_skip_test_list); mark_time_used('collect'); + mysql_install_db(default_mysqld(), "$opt_vardir/install.db") unless using_extern(); + + if ($opt_dry_run) + { + for (@$tests) { + print $_->fullname(), "\n"; + } + exit 0; + } + ####################################################################### my $num_tests= @$tests; if ( $opt_parallel eq "auto" ) { @@ -818,7 +831,7 @@ sub run_test_server ($$$) { redo; } - # Limit number of parallell NDB tests + # Limit number of parallel NDB tests if ($t->{ndb_test} and $num_ndb_tests >= $max_ndb){ #mtr_report("Skipping, num ndb is already at max, $num_ndb_tests"); next; @@ -1050,7 +1063,7 @@ sub print_global_resfile { resfile_global("gprof", $opt_gprof ? 1 : 0); resfile_global("valgrind", $opt_valgrind ? 1 : 0); resfile_global("callgrind", $opt_callgrind ? 1 : 0); - resfile_global("mem", $opt_mem ? 1 : 0); + resfile_global("mem", $opt_mem); resfile_global("tmpdir", $opt_tmpdir); resfile_global("vardir", $opt_vardir); resfile_global("fast", $opt_fast ? 1 : 0); @@ -1064,7 +1077,6 @@ sub print_global_resfile { resfile_global("shutdown-timeout", $opt_shutdown_timeout ? 1 : 0); resfile_global("warnings", $opt_warnings ? 1 : 0); resfile_global("max-connections", $opt_max_connections); -# resfile_global("default-myisam", $opt_default_myisam ? 1 : 0); resfile_global("product", "MySQL"); # Somewhat hacky code to convert numeric version back to dot notation my $v1= int($mysql_version_id / 10000); @@ -1164,6 +1176,7 @@ sub command_line_setup { 'max-save-core=i' => \$opt_max_save_core, 'max-save-datadir=i' => \$opt_max_save_datadir, 'max-test-fail=i' => \$opt_max_test_fail, + 'core-on-failure' => \$opt_core_on_failure, # Coverage, profiling etc 'gcov' => \$opt_gcov, @@ -1225,10 +1238,10 @@ sub command_line_setup { 'stop-file=s' => \$opt_stop_file, 'stop-keep-alive=i' => \$opt_stop_keep_alive, 'max-connections=i' => \$opt_max_connections, - 'default-myisam!' => \&collect_option, 'report-times' => \$opt_report_times, 'result-file' => \$opt_resfile, 'stress=s' => \$opt_stress, + 'dry-run' => \$opt_dry_run, 'help|h' => \$opt_usage, # list-options is internal, not listed in help @@ -1250,11 +1263,6 @@ sub command_line_setup { report_option('verbose', $opt_verbose); } - if ( -d "../sql" ) - { - $source_dist= 1; - } - # Find the absolute path to the test directory $glob_mysql_test_dir= cwd(); if ($glob_mysql_test_dir =~ / /) @@ -1295,10 +1303,6 @@ sub command_line_setup { fix_vs_config_dir(); - # Respect MTR_BINDIR variable, which is typically set in to the - # build directory in out-of-source builds. - $bindir=$ENV{MTR_BINDIR}||$basedir; - # Look for the client binaries directory if ($path_client_bindir) { @@ -1457,12 +1461,14 @@ sub command_line_setup { # Search through list of locations that are known # to be "fast disks" to find a suitable location - # Use --mem=<dir> as first location to look. - my @tmpfs_locations= ($opt_mem,"/run/shm", "/dev/shm", "/tmp"); + my @tmpfs_locations= ("/run/shm", "/dev/shm", "/tmp"); + + # Use $ENV{'MTR_MEM'} as first location to look (if defined) + unshift(@tmpfs_locations, $ENV{'MTR_MEM'}) if defined $ENV{'MTR_MEM'}; foreach my $fs (@tmpfs_locations) { - if ( -d $fs && -w $fs ) + if ( -d $fs && ! -l $fs && -w $fs ) { my $template= "var_${opt_build_thread}_XXXX"; $opt_mem= tempdir( $template, DIR => $fs, CLEANUP => 0); @@ -1935,10 +1941,6 @@ sub collect_mysqld_features_from_running_server () } } - # "Convert" innodb flag - $mysqld_variables{'innodb'}= "ON" - if ($mysqld_variables{'have_innodb'} eq "YES"); - # Parse version my $version_str= $mysqld_variables{'version'}; if ( $version_str =~ /^([0-9]*)\.([0-9]*)\.([0-9]*)([^\s]*)/ ) @@ -2490,6 +2492,17 @@ sub environment_setup { "$path_client_bindir/replace"); $ENV{'REPLACE'}= native_path($exe_replace); + # ---------------------------------------------------- + # innochecksum + # ---------------------------------------------------- + my $exe_innochecksum= + mtr_exe_maybe_exists("$bindir/extra$opt_vs_config/innochecksum", + "$path_client_bindir/innochecksum"); + if ($exe_innochecksum) + { + $ENV{'INNOCHECKSUM'}= native_path($exe_innochecksum); + } + # Create an environment variable to make it possible # to detect that valgrind is being used from test cases $ENV{'VALGRIND_TEST'}= $opt_valgrind; @@ -2666,24 +2679,34 @@ sub setup_vardir() { # and make them world readable copytree("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data", "0022"); - # create a plugin dir and copy plugins into it + # create a plugin dir and copy or symlink plugins into it if ($source_dist) { $plugindir="$opt_vardir/plugins"; mkpath($plugindir); - if (IS_WINDOWS && !$opt_embedded_server) + if (IS_WINDOWS) { - for (<$bindir/storage/*$opt_vs_config/*.dll>, - <$bindir/plugin/*$opt_vs_config/*.dll>, - <$bindir/sql$opt_vs_config/*.dll>) + if (!$opt_embedded_server) { - my $pname=basename($_); - copy rel2abs($_), "$plugindir/$pname"; - set_plugin_var($pname); + for (<$bindir/storage/*$opt_vs_config/*.dll>, + <$bindir/plugin/*$opt_vs_config/*.dll>, + <$bindir/sql$opt_vs_config/*.dll>) + { + my $pname=basename($_); + copy rel2abs($_), "$plugindir/$pname"; + set_plugin_var($pname); + } } } else { + my $opt_use_copy= 1; + if (symlink "$opt_vardir/run", "$plugindir/symlink_test") + { + $opt_use_copy= 0; + unlink "$plugindir/symlink_test"; + } + for (<../storage/*/.libs/*.so>, <../plugin/*/.libs/*.so>, <../plugin/*/*/.libs/*.so>, @@ -2693,7 +2716,14 @@ sub setup_vardir() { <$bindir/sql/*.so>) { my $pname=basename($_); - symlink rel2abs($_), "$plugindir/$pname"; + if ($opt_use_copy) + { + copy rel2abs($_), "$plugindir/$pname"; + } + else + { + symlink rel2abs($_), "$plugindir/$pname"; + } set_plugin_var($pname); } } @@ -3197,15 +3227,26 @@ sub mysql_server_start($) { } my $mysqld_basedir= $mysqld->value('basedir'); + my $extra_opts= get_extra_opts($mysqld, $tinfo); + if ( $basedir eq $mysqld_basedir ) { if (! $opt_start_dirty) # If dirty, keep possibly grown system db { - # Copy datadir from installed system db - my $path= ($opt_parallel == 1) ? "$opt_vardir" : "$opt_vardir/.."; - my $install_db= "$path/install.db"; - copytree($install_db, $datadir) if -d $install_db; - mtr_error("Failed to copy system db to '$datadir'") unless -d $datadir; + # Some InnoDB options are incompatible with the default bootstrap. + # If they are used, re-bootstrap + if ( $extra_opts and + "@$extra_opts" =~ /--innodb[-_](?:page[-_]size|checksum[-_]algorithm|undo[-_]tablespaces|log[-_]group[-_]home[-_]dir|data[-_]home[-_]dir)/ ) + { + mysql_install_db($mysqld, undef, $extra_opts); + } + else { + # Copy datadir from installed system db + my $path= ($opt_parallel == 1) ? "$opt_vardir" : "$opt_vardir/.."; + my $install_db= "$path/install.db"; + copytree($install_db, $datadir) if -d $install_db; + mtr_error("Failed to copy system db to '$datadir'") unless -d $datadir; + } } } else @@ -3244,7 +3285,6 @@ sub mysql_server_start($) { if (!$opt_embedded_server) { - my $extra_opts= get_extra_opts($mysqld, $tinfo); mysqld_start($mysqld,$extra_opts); # Save this test case information, so next can examine it @@ -3468,7 +3508,7 @@ sub default_mysqld { sub mysql_install_db { - my ($mysqld, $datadir)= @_; + my ($mysqld, $datadir, $extra_opts)= @_; my $install_datadir= $datadir || $mysqld->value('datadir'); my $install_basedir= $mysqld->value('basedir'); @@ -3483,11 +3523,16 @@ sub mysql_install_db { mtr_add_arg($args, "--bootstrap"); mtr_add_arg($args, "--basedir=%s", $install_basedir); mtr_add_arg($args, "--datadir=%s", $install_datadir); + mtr_add_arg($args, "--plugin-dir=%s", $plugindir); mtr_add_arg($args, "--default-storage-engine=myisam"); - mtr_add_arg($args, "--skip-$_") for @optional_plugins; + mtr_add_arg($args, "--loose-skip-plugin-$_") for @optional_plugins; + # starting from 10.0 bootstrap scripts require InnoDB + mtr_add_arg($args, "--loose-innodb"); + mtr_add_arg($args, "--loose-innodb-log-file-size=5M"); mtr_add_arg($args, "--disable-sync-frm"); mtr_add_arg($args, "--tmpdir=%s", "$opt_vardir/tmp/"); mtr_add_arg($args, "--core-file"); + mtr_add_arg($args, "--console"); if ( $opt_debug ) { @@ -3520,95 +3565,108 @@ sub mysql_install_db { # ---------------------------------------------------------------------- $ENV{'MYSQLD_BOOTSTRAP_CMD'}= "$exe_mysqld_bootstrap " . join(" ", @$args); - + # Extra options can come not only from the command line, but also + # from option files or combinations. We want them on a command line + # that is executed now, because otherwise the datadir might be + # incompatible with the test settings, but not on the general + # $MYSQLD_BOOTSTRAP_CMD line + foreach my $extra_opt ( @$extra_opts ) { + mtr_add_arg($args, $extra_opt); + } # ---------------------------------------------------------------------- # Create the bootstrap.sql file # ---------------------------------------------------------------------- - my $bootstrap_sql_file= "$opt_vardir/tmp/bootstrap.sql"; - - if ($opt_boot_gdb) { - gdb_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(), - $bootstrap_sql_file); - } - if ($opt_boot_dbx) { - dbx_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(), - $bootstrap_sql_file); - } - if ($opt_boot_ddd) { - ddd_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(), - $bootstrap_sql_file); - } - - my $path_sql= my_find_file($install_basedir, - ["mysql", "sql/share", "share/mariadb", - "share/mysql", "share", "scripts"], - "mysql_system_tables.sql", - NOT_REQUIRED); + my $bootstrap_sql_file= "$opt_vardir/log/bootstrap.sql"; - if (-f $path_sql ) + if (! -e $bootstrap_sql_file) { - my $sql_dir= dirname($path_sql); - # Use the mysql database for system tables - mtr_tofile($bootstrap_sql_file, "use mysql\n"); + if ($opt_boot_gdb) { + gdb_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(), + $bootstrap_sql_file); + } + if ($opt_boot_dbx) { + dbx_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(), + $bootstrap_sql_file); + } + if ($opt_boot_ddd) { + ddd_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(), + $bootstrap_sql_file); + } - # Add the offical mysql system tables - # for a production system - mtr_appendfile_to_file("$sql_dir/mysql_system_tables.sql", - $bootstrap_sql_file); + my $path_sql= my_find_file($install_basedir, + ["mysql", "sql/share", "share/mariadb", + "share/mysql", "share", "scripts"], + "mysql_system_tables.sql", + NOT_REQUIRED); - # Add the performance tables - # for a production system - mtr_appendfile_to_file("$sql_dir/mysql_performance_tables.sql", - $bootstrap_sql_file); + if (-f $path_sql ) + { + my $sql_dir= dirname($path_sql); + # Use the mysql database for system tables + mtr_tofile($bootstrap_sql_file, "use mysql;\n"); + + # Add the offical mysql system tables + # for a production system + mtr_appendfile_to_file("$sql_dir/mysql_system_tables.sql", + $bootstrap_sql_file); + + # Add the performance tables + # for a production system + mtr_appendfile_to_file("$sql_dir/mysql_performance_tables.sql", + $bootstrap_sql_file); + + # Add the mysql system tables initial data + # for a production system + mtr_appendfile_to_file("$sql_dir/mysql_system_tables_data.sql", + $bootstrap_sql_file); + + # Add test data for timezone - this is just a subset, on a real + # system these tables will be populated either by mysql_tzinfo_to_sql + # or by downloading the timezone table package from our website + mtr_appendfile_to_file("$sql_dir/mysql_test_data_timezone.sql", + $bootstrap_sql_file); + + # Fill help tables, just an empty file when running from bk repo + # but will be replaced by a real fill_help_tables.sql when + # building the source dist + mtr_appendfile_to_file("$sql_dir/fill_help_tables.sql", + $bootstrap_sql_file); + + # mysql.gtid_slave_pos was created in InnoDB, but many tests + # run without InnoDB. Alter it to MyISAM now + mtr_tofile($bootstrap_sql_file, "ALTER TABLE gtid_slave_pos ENGINE=MyISAM;\n"); + } + else + { + # Install db from init_db.sql that exist in early 5.1 and 5.0 + # versions of MySQL + my $init_file= "$install_basedir/mysql-test/lib/init_db.sql"; + mtr_report(" - from '$init_file'"); + my $text= mtr_grab_file($init_file) or + mtr_error("Can't open '$init_file': $!"); - # Add the mysql system tables initial data - # for a production system - mtr_appendfile_to_file("$sql_dir/mysql_system_tables_data.sql", - $bootstrap_sql_file); + mtr_tofile($bootstrap_sql_file, + sql_to_bootstrap($text)); + } - # Add test data for timezone - this is just a subset, on a real - # system these tables will be populated either by mysql_tzinfo_to_sql - # or by downloading the timezone table package from our website - mtr_appendfile_to_file("$sql_dir/mysql_test_data_timezone.sql", - $bootstrap_sql_file); + # Remove anonymous users + mtr_tofile($bootstrap_sql_file, + "DELETE FROM mysql.user where user= '';\n"); - # Fill help tables, just an empty file when running from bk repo - # but will be replaced by a real fill_help_tables.sql when - # building the source dist - mtr_appendfile_to_file("$sql_dir/fill_help_tables.sql", - $bootstrap_sql_file); + # Create mtr database + mtr_tofile($bootstrap_sql_file, + "CREATE DATABASE mtr CHARSET=latin1;\n"); - } - else - { - # Install db from init_db.sql that exist in early 5.1 and 5.0 - # versions of MySQL - my $init_file= "$install_basedir/mysql-test/lib/init_db.sql"; - mtr_report(" - from '$init_file'"); - my $text= mtr_grab_file($init_file) or - mtr_error("Can't open '$init_file': $!"); + # Add help tables and data for warning detection and supression + mtr_tofile($bootstrap_sql_file, + sql_to_bootstrap(mtr_grab_file("include/mtr_warnings.sql"))); + # Add procedures for checking server is restored after testcase mtr_tofile($bootstrap_sql_file, - sql_to_bootstrap($text)); + sql_to_bootstrap(mtr_grab_file("include/mtr_check.sql"))); } - # Remove anonymous users - mtr_tofile($bootstrap_sql_file, - "DELETE FROM mysql.user where user= '';\n"); - - # Create mtr database - mtr_tofile($bootstrap_sql_file, - "CREATE DATABASE mtr;\n"); - - # Add help tables and data for warning detection and supression - mtr_tofile($bootstrap_sql_file, - sql_to_bootstrap(mtr_grab_file("include/mtr_warnings.sql"))); - - # Add procedures for checking server is restored after testcase - mtr_tofile($bootstrap_sql_file, - sql_to_bootstrap(mtr_grab_file("include/mtr_check.sql"))); - # Log bootstrap command my $path_bootstrap_log= "$opt_vardir/log/bootstrap.log"; mtr_tofile($path_bootstrap_log, @@ -3630,9 +3688,10 @@ sub mysql_install_db { verbose => $opt_verbose, ) != 0) { + my $data= mtr_grab_file($path_bootstrap_log); mtr_error("Error executing mysqld --bootstrap\n" . "Could not install system database from $bootstrap_sql_file\n" . - "see $path_bootstrap_log for errors"); + "The $path_bootstrap_log file contains:\n$data\n"); } } @@ -4246,11 +4305,18 @@ sub run_testcase ($$) { # foreach my $option ($config->options_in_group("ENV")) { - # Save old value to restore it before next time - $old_env{$option->name()}= $ENV{$option->name()}; + my ($name, $val)= ($option->name(), $option->value()); - mtr_verbose($option->name(), "=",$option->value()); - $ENV{$option->name()}= $option->value(); + # Save old value to restore it before next time + $old_env{$name}= $ENV{$name}; + + unless (defined $val) { + mtr_warning("Uninitialized value for ", $name, + ", group [ENV], file ", $current_config_name); + } else { + mtr_verbose($name, "=", $val); + $ENV{$name}= $val; + } } } @@ -4532,7 +4598,7 @@ sub run_testcase ($$) { } # Try to dump core for mysqltest and all servers - foreach my $proc ($test, started(all_servers())) + foreach my $proc ($test, started(all_servers())) { mtr_print("Trying to dump core for $proc"); if ($proc->dump_core()) @@ -4755,13 +4821,15 @@ sub extract_warning_lines ($$) { qr/Plugin 'ndbcluster' will be forced to shutdown/, qr/InnoDB: Error: in ALTER TABLE `test`.`t[12]`/, qr/InnoDB: Error: table `test`.`t[12]` .*does not exist in the InnoDB internal/, + qr/InnoDB: Warning: Setting innodb_use_sys_malloc/, qr/InnoDB: Warning: a long semaphore wait:/, - qr/Slave: Unknown table 't1' Error_code: 1051/, - qr/Slave SQL:.*(Error_code: [[:digit:]]+|Query:.*)/, + qr/InnoDB: Warning: Writer thread is waiting this semaphore:/, + qr/Slave: Unknown table 't1' .* 1051/, + qr/Slave SQL:.*(Internal MariaDB error code: [[:digit:]]+|Query:.*)/, qr/slave SQL thread aborted/, qr/unknown option '--loose[-_]/, qr/unknown variable 'loose[-_]/, - qr/Invalid .*old.* table or database name/, + #qr/Invalid .*old.* table or database name/, qr/Now setting lower_case_table_names to [02]/, qr/Setting lower_case_table_names=2/, qr/You have forced lower_case_table_names to 0/, @@ -4775,6 +4843,12 @@ sub extract_warning_lines ($$) { qr/Slave I\/O: Get master clock failed with error:.*/, qr/Slave I\/O: Get master COLLATION_SERVER failed with error:.*/, qr/Slave I\/O: Get master TIME_ZONE failed with error:.*/, + qr/Slave I\/O: Get master \@\@GLOBAL.gtid_domain_id failed with error:.*/, + qr/Slave I\/O: Setting \@slave_connect_state failed with error:.*/, + qr/Slave I\/O: Setting \@slave_gtid_strict_mode failed with error:.*/, + qr/Slave I\/O: Setting \@slave_gtid_ignore_duplicates failed with error:.*/, + qr/Slave I\/O: Setting \@slave_until_gtid failed with error:.*/, + qr/Slave I\/O: Get master GTID position failed with error:.*/, qr/Slave I\/O: error reconnecting to master '.*' - retry-time: [1-3] retries/, qr/Slave I\/0: Master command COM_BINLOG_DUMP failed/, qr/Error reading packet/, @@ -4785,7 +4859,8 @@ sub extract_warning_lines ($$) { qr|Checking table: '\..mtr.test_suppressions'|, qr|Table \./test/bug53592 has a primary key in InnoDB data dictionary, but not in MySQL|, qr|Table '\..mtr.test_suppressions' is marked as crashed and should be repaired|, - qr|Can't open shared library.*ha_archive|, + qr|Can't open shared library|, + qr|Couldn't load plugin named .*EXAMPLE.*|, qr|InnoDB: Error: table 'test/bug39438'|, qr| entry '.*' ignored in --skip-name-resolve mode|, qr|mysqld got signal 6|, @@ -4801,6 +4876,8 @@ sub extract_warning_lines ($$) { qr|feedback plugin: failed to retrieve the MAC address|, qr|Plugin 'FEEDBACK' init function returned error|, qr|Plugin 'FEEDBACK' registration as a INFORMATION SCHEMA failed|, + qr|'log-bin-use-v1-row-events' is MySQL 5.6 compatible option|, + qr|InnoDB: Setting thread \d+ nice to \d+ failed, current nice \d+, errno 13|, # setpriority() fails under valgrind qr|Failed to setup SSL|, qr|SSL error: Failed to set ciphers to use|, qr/Plugin 'InnoDB' will be forced to shutdown/, @@ -5188,11 +5265,13 @@ sub after_failure ($) { sub report_failure_and_restart ($) { my $tinfo= shift; - if ($opt_valgrind_mysqld && ($tinfo->{'warnings'} || $tinfo->{'timeout'})) { + if ($opt_valgrind_mysqld && ($tinfo->{'warnings'} || $tinfo->{'timeout'}) && + $opt_core_on_failure == 0) + { # In these cases we may want valgrind report from normal termination $tinfo->{'dont_kill_server'}= 1; } - # Shotdown properly if not to be killed (for valgrind) + # Shutdown properly if not to be killed (for valgrind) stop_all_servers($tinfo->{'dont_kill_server'} ? $opt_shutdown_timeout : 0); $tinfo->{'result'}= 'MTR_RES_FAILED'; @@ -5323,9 +5402,6 @@ sub mysqld_arguments ($$$) { } my $found_skip_core= 0; - my @plugins; - my %seen; - my $plugin; foreach my $arg ( @$extra_opts ) { # Skip --defaults-file option since it's handled above. @@ -5345,12 +5421,6 @@ sub mysqld_arguments ($$$) { { ; # Dont add --skip-log-bin when mysqld have --log-slave-updates in config } - elsif ($plugin = mtr_match_prefix($arg, "--plugin-load=")) - { - next if $plugin =~ /=$/; - push @plugins, $plugin unless $seen{$plugin}; - $seen{$plugin} = 1; - } else { mtr_add_arg($args, "%s", $arg); @@ -5367,11 +5437,6 @@ sub mysqld_arguments ($$$) { mtr_add_arg($args, "--loose-debug-sync-timeout=%s", $opt_debug_sync_timeout) unless $opt_user_args; - if (@plugins) { - my $sep = (IS_WINDOWS) ? ';' : ':'; - mtr_add_arg($args, "--plugin-load=%s" . join($sep, @plugins)); - } - return $args; } @@ -5426,6 +5491,11 @@ sub mysqld_start ($$) { } } + # "Dynamic" version of MYSQLD_CMD is reevaluated with each mysqld_start. + # Use it to restart the server at testing a failing server start (e.g + # due to incompatible options). + $ENV{'MYSQLD_LAST_CMD'}= "$exe @$args"; + if ( $opt_gdb || $opt_manual_gdb ) { gdb_arguments(\$args, \$exe, $mysqld->name()); @@ -5697,7 +5767,7 @@ sub get_extra_opts { sub stop_servers($$) { my (@servers)= @_; - mtr_report("Restarting ", started(@servers)); + mtr_report("Stopping ", started(@servers)); My::SafeProcess::shutdown($opt_shutdown_timeout, started(@servers)); @@ -5854,6 +5924,13 @@ sub start_mysqltest ($) { mtr_add_arg($args, "--sleep=%d", $opt_sleep); } + if ( $opt_valgrind_mysqld ) + { + # We are running server under valgrind, which causes some replication + # test to be much slower, notable rpl_mdev6020. Increase timeout. + mtr_add_arg($args, "--wait-for-pos-timeout=0"); + } + if ( $opt_ssl ) { # Turn on SSL for _all_ test cases if option --ssl was used @@ -6185,7 +6262,7 @@ sub debugger_arguments { $$exe= $debugger; } - elsif ( $debugger =~ /windbg/ ) + elsif ( $debugger =~ /windbg|vsjitdebugger/ ) { # windbg exe arg1 .. argn @@ -6202,7 +6279,6 @@ sub debugger_arguments { } } - # # Modify the exe and args so that program is run in valgrind # @@ -6222,15 +6298,16 @@ sub valgrind_arguments { mtr_add_arg($args, "--num-callers=16"); mtr_add_arg($args, "--suppressions=%s/valgrind.supp", $glob_mysql_test_dir) if -f "$glob_mysql_test_dir/valgrind.supp"; - my $exe_mysqld= find_mysqld($bindir) || ""; - my $temp= `ldd $exe_mysqld | grep 'libjemalloc'`; - if ($temp) - { - mtr_add_arg($args, "--soname-synonyms=somalloc=libjemalloc*"); - } - else + + # Ensure the jemalloc works with mysqld + if ($$exe =~ /mysqld/) { - mtr_add_arg($args, "--soname-synonyms=somalloc=NONE"); + my %somalloc=( + 'system jemalloc' => 'libjemalloc*', + 'bundled jemalloc' => 'NONE' + ); + my ($syn) = $somalloc{$mysqld_variables{'version-malloc-library'}}; + mtr_add_arg($args, '--soname-synonyms=somalloc=%s', $syn) if $syn; } } @@ -6363,7 +6440,20 @@ sub usage ($) { $0 [ OPTIONS ] [ TESTCASE ] -Options to control what engine/variation to run +Where test case can be specified as: + +testcase[.test] Runs the test case named 'testcase' from all suits +path-to-testcase +[suite.]testcase[,combination] + +Examples: + +alias +main.alias 'main' is the name of the suite for the 't' directory. +rpl.rpl_invoked_features,mix,xtradb_plugin +suite/rpl/t/rpl.rpl_invoked_features + +Options to control what engine/variation to run: embedded-server Use the embedded server, i.e. no mysqld daemons ps-protocol Use the binary protocol between client and server @@ -6374,16 +6464,18 @@ Options to control what engine/variation to run non-blocking-api Use the non-blocking client API compress Use the compressed protocol between client and server ssl Use ssl protocol between client and server - skip-ssl Dont start server with support for ssl connections + skip-ssl Don't start server with support for ssl connections vs-config Visual Studio configuration used to create executables (default: MTR_VS_CONFIG environment variable) - parallel=# How many parallell test should be run + parallel=# How many parallel test should be run defaults-file=<config template> Use fixed config template for all tests defaults-extra-file=<config template> Extra config template to add to all generated configs combination=<opt> Use at least twice to run tests with specified options to mysqld + dry-run Don't run any tests, print the list of tests + that were selected for execution Options to control directories to use tmpdir=DIR The directory where temporary files are stored @@ -6391,9 +6483,9 @@ Options to control directories to use vardir=DIR The directory where files generated from the test run is stored (default: ./var). Specifying a ramdisk or tmpfs will speed up tests. - mem Run testsuite in "memory" using tmpfs or ramdisk - Attempts to find a suitable location - using a builtin list of standard locations + mem[=DIR] Run testsuite in "memory" using tmpfs or ramdisk + Attempts to use DIR first if specified else + uses a builtin list of standard locations for tmpfs (/run/shm, /dev/shm, /tmp) The option can also be set using environment variable MTR_MEM=[DIR] @@ -6504,10 +6596,11 @@ Options for debugging the product 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_DATADIR - max-test-fail Limit the number of test failurs before aborting + max-test-fail Limit the number of test failures before aborting the current test run. Defaults to $opt_max_test_fail, set to 0 for no limit. Set it's default with MTR_MAX_TEST_FAIL + core-in-failure Generate a core even if run server is run with valgrind Options for valgrind @@ -6547,11 +6640,11 @@ Misc options start-dirty Only start the servers (without initialization) for the first specified test case user-args In combination with start* and no test name, drops - arguments to mysqld except those speficied with + arguments to mysqld except those specified with --mysqld (if any) wait-all If --start or --start-dirty option is used, wait for all servers to exit before finishing the process - fast Run as fast as possible, dont't wait for servers + fast Run as fast as possible, don't wait for servers to shutdown etc. force-restart Always restart servers between tests parallel=N Run tests in N parallel threads (default 1) @@ -6562,7 +6655,7 @@ Misc options failures before stopping, set with the --retry-failure option retry-failure=N When using the --retry option to retry failed tests, - stop when N failures have occured (default $opt_retry_failure) + stop when N failures have occurred (default $opt_retry_failure) reorder Reorder tests to get fewer server restarts help Get this help text @@ -6586,7 +6679,7 @@ Misc options actions. Disable facility with NUM=0. gcov Collect coverage information after the test. The result is a gcov file per source and header file. - gcov-src-dir=subdir Colllect coverage only within the given subdirectory. + gcov-src-dir=subdir Collect coverage only within the given subdirectory. For example, if you're only developing the SQL layer, it makes sense to use --gcov-src-dir=sql gprof Collect profiling information using gprof. @@ -6596,9 +6689,6 @@ Misc options timediff With --timestamp, also print time passed since *previous* test started max-connections=N Max number of open connection to server in mysqltest - default-myisam Set default storage engine to MyISAM for non-innodb - tests. This is needed after switching default storage - engine to InnoDB. report-times Report how much time has been spent on different phases of test execution. stress=ARGS Run stress test, providing options to |