[TEST] Ensure all nodes indicate job has been stopped

Original commit: elastic/x-pack-elasticsearch@39184b6c69
This commit is contained in:
Martijn van Groningen 2017-04-11 15:14:28 +02:00
parent cb735b5f69
commit e1aac25f2d
1 changed files with 6 additions and 3 deletions

View File

@ -6,6 +6,7 @@
package org.elasticsearch.xpack.ml.integration;
import org.elasticsearch.ElasticsearchStatusException;
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
@ -98,9 +99,11 @@ public class TooManyJobsIT extends BaseMlIntegTestCase {
assertTrue(closeResponse.isClosed());
client().execute(OpenJobAction.INSTANCE, openJobRequest).get();
assertBusy(() -> {
GetJobsStatsAction.Response statsResponse =
client().execute(GetJobsStatsAction.INSTANCE, new GetJobsStatsAction.Request(job.getId())).actionGet();
assertEquals(statsResponse.getResponse().results().get(0).getState(), JobState.OPENED);
for (Client client : clients()) {
GetJobsStatsAction.Response statsResponse =
client.execute(GetJobsStatsAction.INSTANCE, new GetJobsStatsAction.Request(job.getId())).actionGet();
assertEquals(statsResponse.getResponse().results().get(0).getState(), JobState.OPENED);
}
});
return;
}