Wait for ML templates after creating a new cluster in TooManyJobsIT (#54801)

This commit is contained in:
David Kyle 2020-04-06 13:45:56 +01:00 committed by GitHub
parent 2b8a91b7be
commit 03bc368c14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -14,6 +14,7 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.persistent.PersistentTasksCustomMetadata;
import org.elasticsearch.transport.TransportService;
import org.elasticsearch.xpack.core.ml.MlTasks;
import org.elasticsearch.xpack.core.ml.action.CloseJobAction;
@ -23,14 +24,11 @@ import org.elasticsearch.xpack.core.ml.action.PutJobAction;
import org.elasticsearch.xpack.core.ml.job.config.Job;
import org.elasticsearch.xpack.core.ml.job.config.JobState;
import org.elasticsearch.xpack.core.ml.job.config.JobTaskState;
import org.elasticsearch.persistent.PersistentTasksCustomMetadata;
import org.elasticsearch.xpack.ml.MachineLearning;
import org.elasticsearch.xpack.ml.support.BaseMlIntegTestCase;
import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
public class TooManyJobsIT extends BaseMlIntegTestCase {
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/54162")
public void testCloseFailedJob() throws Exception {
startMlCluster(1, 1);
@ -76,6 +74,7 @@ public class TooManyJobsIT extends BaseMlIntegTestCase {
}
logger.info("Started [{}] nodes", numNodes);
ensureStableCluster(numNodes);
ensureTemplatesArePresent();
logger.info("[{}] is [{}]", MachineLearning.MAX_LAZY_ML_NODES.getKey(), maxNumberOfLazyNodes);
// Set our lazy node number
assertTrue(client().admin()
@ -210,6 +209,7 @@ public class TooManyJobsIT extends BaseMlIntegTestCase {
}
logger.info("Started [{}] nodes", numNodes);
ensureStableCluster(numNodes);
ensureTemplatesArePresent();
}
private long calculateMaxMlMemory() {