Additional assertions for SLM restart tests (#48428)
Adds the ability to conditionally wipe SLM policies and ensures that you can read what you wrote across restarts.
This commit is contained in:
parent
f6686345c9
commit
1197ebb9e9
|
@ -473,13 +473,22 @@ public abstract class ESRestTestCase extends ESTestCase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether to preserve ILM Policies of this test. Defaults to not
|
* Returns whether to preserve ILM Policies of this test. Defaults to not
|
||||||
* preserviing them. Only runs at all if xpack is installed on the cluster
|
* preserving them. Only runs at all if xpack is installed on the cluster
|
||||||
* being tested.
|
* being tested.
|
||||||
*/
|
*/
|
||||||
protected boolean preserveILMPoliciesUponCompletion() {
|
protected boolean preserveILMPoliciesUponCompletion() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether to preserve SLM Policies of this test. Defaults to not
|
||||||
|
* preserving them. Only runs at all if xpack is installed on the cluster
|
||||||
|
* being tested.
|
||||||
|
*/
|
||||||
|
protected boolean preserveSLMPoliciesUponCompletion() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A set of ILM policies that should be preserved between runs.
|
* A set of ILM policies that should be preserved between runs.
|
||||||
*/
|
*/
|
||||||
|
@ -514,7 +523,10 @@ public abstract class ESRestTestCase extends ESTestCase {
|
||||||
|
|
||||||
// Clean up SLM policies before trying to wipe snapshots so that no new ones get started by SLM after wiping
|
// Clean up SLM policies before trying to wipe snapshots so that no new ones get started by SLM after wiping
|
||||||
if (nodeVersions.first().onOrAfter(Version.V_7_4_0)) { // SLM was introduced in version 7.4
|
if (nodeVersions.first().onOrAfter(Version.V_7_4_0)) { // SLM was introduced in version 7.4
|
||||||
deleteAllSLMPolicies();
|
if (preserveSLMPoliciesUponCompletion() == false) {
|
||||||
|
// Clean up SLM policies before trying to wipe snapshots so that no new ones get started by SLM after wiping
|
||||||
|
deleteAllSLMPolicies();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetOnce<Map<String, List<Map<?,?>>>> inProgressSnapshots = new SetOnce<>();
|
SetOnce<Map<String, List<Map<?,?>>>> inProgressSnapshots = new SetOnce<>();
|
||||||
|
|
|
@ -109,4 +109,9 @@ public abstract class AbstractFullClusterRestartTestCase extends ESRestTestCase
|
||||||
protected boolean preserveILMPoliciesUponCompletion() {
|
protected boolean preserveILMPoliciesUponCompletion() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean preserveSLMPoliciesUponCompletion() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue