Skip to content

Commit fcacb78

Browse files
committed
[ML] Fix MlAssignmentPlannerUpgradeIT.estMlAssignmentPlannerUpgrade() (elastic#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 273fd6c commit fcacb78

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
@@ -66,7 +66,6 @@ public class MlAssignmentPlannerUpgradeIT extends AbstractUpgradeTestCase {
6666
RAW_MODEL_SIZE = Base64.getDecoder().decode(BASE_64_ENCODED_MODEL).length;
6767
}
6868

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

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

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

197196
private void cleanupDeployments() throws IOException {
@@ -247,10 +246,14 @@ private void deleteTrainedModel(String modelId) throws IOException {
247246
}
248247

249248
private Response startDeployment(String modelId) throws IOException {
250-
return startDeployment(modelId, "started");
249+
return startDeployment(modelId, "started", "normal");
251250
}
252251

253252
private Response startDeployment(String modelId, String waitForState) throws IOException {
253+
return startDeployment(modelId, waitForState, "normal");
254+
}
255+
256+
private Response startDeployment(String modelId, String waitForState, String priority) throws IOException {
254257
String inferenceThreadParamName = "threads_per_allocation";
255258
String modelThreadParamName = "number_of_allocations";
256259
String compatibleHeader = null;
@@ -270,7 +273,8 @@ private Response startDeployment(String modelId, String waitForState) throws IOE
270273
+ inferenceThreadParamName
271274
+ "=1&"
272275
+ modelThreadParamName
273-
+ "=1"
276+
+ "=1&priority="
277+
+ priority
274278
);
275279
if (compatibleHeader != null) {
276280
request.setOptions(request.getOptions().toBuilder().addHeader("Accept", compatibleHeader).build());

0 commit comments

Comments
 (0)