Skip to content

Commit

Permalink
Enable not wiping cluster settings after REST test (#33575)
Browse files Browse the repository at this point in the history
In some cases we want to skip wiping cluster settings after a REST
test. For example, one use-case would be in the full cluster restart
tests where want to test cluster settings before and after a full
cluster restart. If we wipe the cluster settings before the restart,
then it would not be possible to assert on them after the restart.
  • Loading branch information
jasontedor authored Sep 10, 2018
1 parent 9a2c77d commit 5f42447
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,16 @@ protected boolean preserveTemplatesUponCompletion() {
return false;
}

/**
* Controls whether or not to preserve cluster settings upon completion of the test. The default implementation is to remove all cluster
* settings.
*
* @return true if cluster settings should be preserved and otherwise false
*/
protected boolean preserveClusterSettings() {
return false;
}

/**
* Returns whether to preserve the repositories on completion of this test.
* Defaults to not preserving repos. See also
Expand Down Expand Up @@ -295,7 +305,11 @@ private void wipeCluster() throws IOException {
}

wipeSnapshots();
wipeClusterSettings();

// wipe cluster settings
if (preserveClusterSettings() == false) {
wipeClusterSettings();
}
}

/**
Expand Down

0 comments on commit 5f42447

Please sign in to comment.