[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();
|
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;
|
||||||
|
|
Loading…
Reference in New Issue