|
@@ -83,27 +83,27 @@ public class GetAutoscalingCapacityRestCancellationIT extends AutoscalingIntegTe
|
|
PlainActionFuture<Response> successFuture2 = new PlainActionFuture<>();
|
|
PlainActionFuture<Response> successFuture2 = new PlainActionFuture<>();
|
|
Request getCapacityRequest = new Request("GET", "/_autoscaling/capacity");
|
|
Request getCapacityRequest = new Request("GET", "/_autoscaling/capacity");
|
|
Cancellable cancellable = restClient.performRequestAsync(getCapacityRequest, wrapAsRestResponseListener(cancelledFuture));
|
|
Cancellable cancellable = restClient.performRequestAsync(getCapacityRequest, wrapAsRestResponseListener(cancelledFuture));
|
|
- LocalStateAutoscaling.AutoscalingTestPlugin plugin = internalCluster().getMasterNodeInstance(PluginsService.class)
|
|
|
|
|
|
+ LocalStateAutoscaling.AutoscalingTestPlugin plugin = internalCluster().getAnyMasterNodeInstance(PluginsService.class)
|
|
.filterPlugins(LocalStateAutoscaling.class)
|
|
.filterPlugins(LocalStateAutoscaling.class)
|
|
.get(0)
|
|
.get(0)
|
|
.testPlugin();
|
|
.testPlugin();
|
|
plugin.syncWithDeciderService(() -> {
|
|
plugin.syncWithDeciderService(() -> {
|
|
putAutoscalingPolicy(Map.of(AutoscalingCountTestDeciderService.NAME, Settings.EMPTY));
|
|
putAutoscalingPolicy(Map.of(AutoscalingCountTestDeciderService.NAME, Settings.EMPTY));
|
|
assertThat(
|
|
assertThat(
|
|
- internalCluster().getMasterNodeInstance(TransportGetAutoscalingCapacityAction.class).responseCacheQueueSize(),
|
|
|
|
|
|
+ internalCluster().getAnyMasterNodeInstance(TransportGetAutoscalingCapacityAction.class).responseCacheQueueSize(),
|
|
equalTo(1)
|
|
equalTo(1)
|
|
);
|
|
);
|
|
restClient.performRequestAsync(getCapacityRequest, wrapAsRestResponseListener(successFuture1));
|
|
restClient.performRequestAsync(getCapacityRequest, wrapAsRestResponseListener(successFuture1));
|
|
assertBusy(
|
|
assertBusy(
|
|
() -> assertThat(
|
|
() -> assertThat(
|
|
- internalCluster().getMasterNodeInstance(TransportGetAutoscalingCapacityAction.class).responseCacheQueueSize(),
|
|
|
|
|
|
+ internalCluster().getAnyMasterNodeInstance(TransportGetAutoscalingCapacityAction.class).responseCacheQueueSize(),
|
|
equalTo(2)
|
|
equalTo(2)
|
|
)
|
|
)
|
|
);
|
|
);
|
|
restClient.performRequestAsync(getCapacityRequest, wrapAsRestResponseListener(successFuture2));
|
|
restClient.performRequestAsync(getCapacityRequest, wrapAsRestResponseListener(successFuture2));
|
|
assertBusy(
|
|
assertBusy(
|
|
() -> assertThat(
|
|
() -> assertThat(
|
|
- internalCluster().getMasterNodeInstance(TransportGetAutoscalingCapacityAction.class).responseCacheQueueSize(),
|
|
|
|
|
|
+ internalCluster().getAnyMasterNodeInstance(TransportGetAutoscalingCapacityAction.class).responseCacheQueueSize(),
|
|
equalTo(3)
|
|
equalTo(3)
|
|
)
|
|
)
|
|
);
|
|
);
|
|
@@ -130,7 +130,7 @@ public class GetAutoscalingCapacityRestCancellationIT extends AutoscalingIntegTe
|
|
|
|
|
|
private void waitForCancelledCapacityTask() throws Exception {
|
|
private void waitForCancelledCapacityTask() throws Exception {
|
|
assertBusy(() -> {
|
|
assertBusy(() -> {
|
|
- TransportService transportService = internalCluster().getMasterNodeInstance(TransportService.class);
|
|
|
|
|
|
+ TransportService transportService = internalCluster().getAnyMasterNodeInstance(TransportService.class);
|
|
final TaskManager taskManager = transportService.getTaskManager();
|
|
final TaskManager taskManager = transportService.getTaskManager();
|
|
assertTrue(taskManager.assertCancellableTaskConsistency());
|
|
assertTrue(taskManager.assertCancellableTaskConsistency());
|
|
for (CancellableTask cancellableTask : taskManager.getCancellableTasks().values()) {
|
|
for (CancellableTask cancellableTask : taskManager.getCancellableTasks().values()) {
|