[Transform] wait for transform templates in Rest integration t… (#53330)
add transform templates to the list of templates to be installed before executing tests
This commit is contained in:
parent
d503bf9a45
commit
5912895838
|
@ -6,6 +6,7 @@
|
||||||
package org.elasticsearch.xpack.test.rest;
|
package org.elasticsearch.xpack.test.rest;
|
||||||
|
|
||||||
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
|
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
|
||||||
|
|
||||||
import org.apache.http.HttpStatus;
|
import org.apache.http.HttpStatus;
|
||||||
import org.elasticsearch.ElasticsearchException;
|
import org.elasticsearch.ElasticsearchException;
|
||||||
import org.elasticsearch.common.CheckedFunction;
|
import org.elasticsearch.common.CheckedFunction;
|
||||||
|
@ -24,6 +25,7 @@ import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndex;
|
||||||
import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndexFields;
|
import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndexFields;
|
||||||
import org.elasticsearch.xpack.core.ml.notifications.NotificationsIndex;
|
import org.elasticsearch.xpack.core.ml.notifications.NotificationsIndex;
|
||||||
import org.elasticsearch.xpack.core.rollup.job.RollupJob;
|
import org.elasticsearch.xpack.core.rollup.job.RollupJob;
|
||||||
|
import org.elasticsearch.xpack.core.transform.transforms.persistence.TransformInternalIndexConstants;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
||||||
|
@ -75,7 +77,7 @@ public class XPackRestIT extends ESClientYamlSuiteTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Waits for the Security template and the Machine Learning templates to be created by the {@link MetaDataUpgrader}
|
* Waits for Machine Learning and Transform templates to be created by the {@link MetaDataUpgrader}
|
||||||
*/
|
*/
|
||||||
private void waitForTemplates() throws Exception {
|
private void waitForTemplates() throws Exception {
|
||||||
if (installTemplates()) {
|
if (installTemplates()) {
|
||||||
|
@ -86,7 +88,10 @@ public class XPackRestIT extends ESClientYamlSuiteTestCase {
|
||||||
MlMetaIndex.INDEX_NAME,
|
MlMetaIndex.INDEX_NAME,
|
||||||
AnomalyDetectorsIndexFields.STATE_INDEX_PREFIX,
|
AnomalyDetectorsIndexFields.STATE_INDEX_PREFIX,
|
||||||
AnomalyDetectorsIndex.jobResultsIndexPrefix(),
|
AnomalyDetectorsIndex.jobResultsIndexPrefix(),
|
||||||
AnomalyDetectorsIndex.configIndexName()));
|
AnomalyDetectorsIndex.configIndexName(),
|
||||||
|
TransformInternalIndexConstants.AUDIT_INDEX,
|
||||||
|
TransformInternalIndexConstants.LATEST_INDEX_NAME
|
||||||
|
));
|
||||||
|
|
||||||
for (String template : templates) {
|
for (String template : templates) {
|
||||||
awaitCallApi("indices.exists_template", singletonMap("name", template), emptyList(),
|
awaitCallApi("indices.exists_template", singletonMap("name", template), emptyList(),
|
||||||
|
|
Loading…
Reference in New Issue