[TEST] Use cluster state api to check whether job state is closed.
Original commit: elastic/x-pack-elasticsearch@27c9aa0c41
This commit is contained in:
parent
81abd29598
commit
f1b529291a
|
@ -99,9 +99,9 @@ public class TooManyJobsIT extends BaseMlIntegTestCase {
|
|||
client().execute(OpenJobAction.INSTANCE, openJobRequest).actionGet();
|
||||
assertBusy(() -> {
|
||||
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);
|
||||
PersistentTasksCustomMetaData tasks = client.admin().cluster().prepareState().get().getState()
|
||||
.getMetaData().custom(PersistentTasksCustomMetaData.TYPE);
|
||||
assertEquals(MlMetadata.getJobState(job.getId(), tasks), JobState.OPENED);
|
||||
}
|
||||
});
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue