Skip to content

Commit f446a4b

Browse files
authored
[ML] Fix MlAssignmentPlannerUpgradeIT.estMlAssignmentPlannerUpgrade() (#137080)
As suggested here, this PR changes deployments to low priority. Low priority deployments don't require specific processor allocations, allowing them to run in constrained environments. The test can now succeed in single-processor test environments where all processors are already allocated. Since we don't test BWC for pre-8.6.0 versions, where priority was introduced, this change fixes the test.
1 parent 5884725 commit f446a4b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/MlAssignmentPlannerUpgradeIT.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ public class MlAssignmentPlannerUpgradeIT extends AbstractUpgradeTestCase {
6767
RAW_MODEL_SIZE = Base64.getDecoder().decode(BASE_64_ENCODED_MODEL).length;
6868
}
6969

70-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/101926")
7170
public void testMlAssignmentPlannerUpgrade() throws Exception {
7271
assumeFalse("This test deploys multiple models which cannot be accommodated on a single processor", IS_SINGLE_PROCESSOR_TEST);
7372

@@ -187,12 +186,12 @@ private void setupDeployments() throws Exception {
187186
createTrainedModel("old_memory_format", 0, 0);
188187
putModelDefinition("old_memory_format");
189188
putVocabulary(List.of("these", "are", "my", "words"), "old_memory_format");
190-
startDeployment("old_memory_format");
189+
startDeployment("old_memory_format", "started", "low");
191190

192191
createTrainedModel("new_memory_format", ByteSizeValue.ofMb(300).getBytes(), ByteSizeValue.ofMb(10).getBytes());
193192
putModelDefinition("new_memory_format");
194193
putVocabulary(List.of("these", "are", "my", "words"), "new_memory_format");
195-
startDeployment("new_memory_format");
194+
startDeployment("new_memory_format", "started", "low");
196195
}
197196

198197
private void cleanupDeployments() throws IOException {
@@ -248,10 +247,14 @@ private void deleteTrainedModel(String modelId) throws IOException {
248247
}
249248

250249
private Response startDeployment(String modelId) throws IOException {
251-
return startDeployment(modelId, "started");
250+
return startDeployment(modelId, "started", "normal");
252251
}
253252

254253
private Response startDeployment(String modelId, String waitForState) throws IOException {
254+
return startDeployment(modelId, waitForState, "normal");
255+
}
256+
257+
private Response startDeployment(String modelId, String waitForState, String priority) throws IOException {
255258
String inferenceThreadParamName = "threads_per_allocation";
256259
String modelThreadParamName = "number_of_allocations";
257260
String compatibleHeader = null;
@@ -271,7 +274,8 @@ private Response startDeployment(String modelId, String waitForState) throws IOE
271274
+ inferenceThreadParamName
272275
+ "=1&"
273276
+ modelThreadParamName
274-
+ "=1"
277+
+ "=1&priority="
278+
+ priority
275279
);
276280
if (compatibleHeader != null) {
277281
request.setOptions(request.getOptions().toBuilder().addHeader("Accept", compatibleHeader).build());

0 commit comments

Comments
 (0)