Skip to content

Commit 5cd2242

Browse files
Updating comments
1 parent 3167cbd commit 5cd2242

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

x-pack/plugin/inference/qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/xpack/application/AuthorizationTaskExecutorUpgradeIT.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ public class AuthorizationTaskExecutorUpgradeIT extends ParameterizedRollingUpgr
3737
.setting("xpack.security.enabled", "false")
3838
.setting("xpack.license.self_generated.type", "trial")
3939
.setting(PERIODIC_AUTHORIZATION_ENABLED.getKey(), "false")
40-
// We need a url set for the authorization task to be scheduled, but we don't actually care if we get a valid response
40+
// We need a url set for the authorization task to be created, but we don't actually care if we get a valid response
4141
// just that the task will be created upon upgrade
4242
.setting(ELASTIC_INFERENCE_SERVICE_URL.getKey(), "http://localhost:12345")
4343
.build();
4444

45-
static final String GET_METHOD = "GET";
45+
private static final String GET_METHOD = "GET";
4646

4747
public AuthorizationTaskExecutorUpgradeIT(@Name("upgradedNodes") int upgradedNodes) {
4848
super(upgradedNodes);
@@ -64,7 +64,8 @@ public void testUpgradeAuthorizationTaskExecutor() throws Exception {
6464
assertFalse(doesAuthPollingTaskExist());
6565
}
6666
if (isMixedCluster()) {
67-
// if we're in a mixed cluster state wh
67+
// if we're in the middle of an upgrade where some nodes are upgraded and some are not, the task should
68+
// still not be created. It should wait until all nodes are upgraded
6869
assertFalse(doesAuthPollingTaskExist());
6970
}
7071
}
@@ -117,10 +118,10 @@ private static boolean doesAuthPollingTaskExist() throws IOException {
117118
return false;
118119
}
119120

120-
for (Object taskObj : tasks.values()) {
121+
for (var taskObj : tasks.values()) {
121122
var task = (Map<String, Object>) taskObj;
122123
var action = (String) task.get("action");
123-
if ((action != null && action.startsWith(AuthorizationPoller.TASK_NAME))) {
124+
if (action != null && action.startsWith(AuthorizationPoller.TASK_NAME)) {
124125
return true;
125126
}
126127
}

0 commit comments

Comments
 (0)