Enable not wiping cluster settings after REST test (#33575)

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.
This commit is contained in:
Jason Tedor 2018-09-10 14:25:30 -04:00 committed by GitHub
parent 9a2c77d1c3
commit 5f4244755e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 1 deletions

View File

@ -236,6 +236,16 @@ public abstract class ESRestTestCase extends ESTestCase {
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
@ -295,7 +305,11 @@ public abstract class ESRestTestCase extends ESTestCase {
}
wipeSnapshots();
wipeClusterSettings();
// wipe cluster settings
if (preserveClusterSettings() == false) {
wipeClusterSettings();
}
}
/**