summaryrefslogtreecommitdiff
path: root/mysql-test/mysql-test-run.pl
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-07-25 18:42:06 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-07-25 18:42:06 +0300
commite9c1701e11e2441435223cc7c00c467f58aaff19 (patch)
tree6be7d0e8fe87272e1abb2704fdb9859481d8acc2 /mysql-test/mysql-test-run.pl
parent17794fb9aac9ca4fcb0b1e5904671a025a1b6b74 (diff)
parentf3eb82f048d342c11fc3869eca2e6faed9a4835d (diff)
downloadmariadb-git-e9c1701e11e2441435223cc7c00c467f58aaff19.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'mysql-test/mysql-test-run.pl')
-rwxr-xr-xmysql-test/mysql-test-run.pl43
1 files changed, 39 insertions, 4 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 40ac09cac96..51f5617244c 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -1008,6 +1008,8 @@ sub run_test_server ($$$) {
next if (defined $t->{reserved} and $t->{reserved} != $wid);
if (! defined $t->{reserved})
{
+ # Force-restart not relevant when comparing *next* test
+ $t->{criteria} =~ s/force-restart$/no-restart/;
my $criteria= $t->{criteria};
# Reserve similar tests for this worker, but not too many
my $maxres= (@$tests - $i) / $opt_parallel + 1;
@@ -2046,7 +2048,10 @@ sub collect_mysqld_features {
if (/Copyright/ .. /^-{30,}/) {
# here we want to detect all not mandatory plugins
# they are listed in the --help output as
- # --archive[=name] Enable or disable ARCHIVE plugin. Possible values are ON, OFF, FORCE (don't start if the plugin fails to load).
+ # --archive[=name]
+ # Enable or disable ARCHIVE plugin. Possible values are ON, OFF,
+ # FORCE (don't start if the plugin fails to load),
+ # FORCE_PLUS_PERMANENT (like FORCE, but the plugin can not be uninstalled).
push @optional_plugins, $1
if /^ --([-a-z0-9]+)\[=name\] +Enable or disable \w+ plugin. One of: ON, OFF, FORCE/;
next;
@@ -3899,6 +3904,25 @@ sub find_analyze_request
return $analyze;
}
+# The test can leave a file in var/tmp/ to signal
+# that all servers should be restarted
+sub restart_forced_by_test($)
+{
+ my $file = shift;
+ my $restart = 0;
+ foreach my $mysqld ( mysqlds() )
+ {
+ my $datadir = $mysqld->value('datadir');
+ my $force_restart_file = "$datadir/mtr/$file";
+ if ( -f $force_restart_file )
+ {
+ mtr_verbose("Restart of servers forced by test");
+ $restart = 1;
+ last;
+ }
+ }
+ return $restart;
+}
# Return timezone value of tinfo or default value
sub timezone {
@@ -4259,8 +4283,12 @@ sub run_testcase ($$) {
if ( $res == 0 )
{
my $check_res;
- if ( $opt_check_testcases and
- $check_res= check_testcase($tinfo, "after"))
+ if ( restart_forced_by_test('force_restart') )
+ {
+ stop_all_servers($opt_shutdown_timeout);
+ }
+ elsif ( $opt_check_testcases and
+ $check_res= check_testcase($tinfo, "after"))
{
if ($check_res == 1) {
# Test case had sideeffects, not fatal error, just continue
@@ -4295,7 +4323,8 @@ sub run_testcase ($$) {
find_testcase_skipped_reason($tinfo);
mtr_report_test_skipped($tinfo);
# Restart if skipped due to missing perl, it may have had side effects
- if ( $tinfo->{'comment'} =~ /^perl not found/ )
+ if ( restart_forced_by_test('force_restart_if_skipped') ||
+ $tinfo->{'comment'} =~ /^perl not found/ )
{
stop_all_servers($opt_shutdown_timeout);
}
@@ -5447,6 +5476,11 @@ sub server_need_restart {
return 0;
}
+ if ( $tinfo->{'force_restart'} ) {
+ mtr_verbose_restart($server, "forced in .opt file");
+ return 1;
+ }
+
if ( $opt_force_restart ) {
mtr_verbose_restart($server, "forced restart turned on");
return 1;
@@ -6541,6 +6575,7 @@ Misc options
servers to exit before finishing the process
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)
Use parallel=auto for auto-setting of N
repeat=N Run each test N number of times