[TEST] Use cluster state api to check whether job state is closed.

Original commit: elastic/x-pack-elasticsearch@27c9aa0c41
This commit is contained in:
Martijn van Groningen 2017-04-13 13:39:43 +02:00
parent 81abd29598
commit f1b529291a
1 changed files with 3 additions and 3 deletions

View File

@ -99,9 +99,9 @@ public class TooManyJobsIT extends BaseMlIntegTestCase {
client().execute(OpenJobAction.INSTANCE, openJobRequest).actionGet(); client().execute(OpenJobAction.INSTANCE, openJobRequest).actionGet();
assertBusy(() -> { assertBusy(() -> {
for (Client client : clients()) { for (Client client : clients()) {
GetJobsStatsAction.Response statsResponse = PersistentTasksCustomMetaData tasks = client.admin().cluster().prepareState().get().getState()
client.execute(GetJobsStatsAction.INSTANCE, new GetJobsStatsAction.Request(job.getId())).actionGet(); .getMetaData().custom(PersistentTasksCustomMetaData.TYPE);
assertEquals(statsResponse.getResponse().results().get(0).getState(), JobState.OPENED); assertEquals(MlMetadata.getJobState(job.getId(), tasks), JobState.OPENED);
} }
}); });
return; return;