Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Fix upgrade test assertion #95748

Merged
merged 3 commits into from
May 3, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.oneOf;

public class MLModelDeploymentsUpgradeIT extends AbstractUpgradeTestCase {

Expand Down Expand Up @@ -73,6 +74,7 @@ public void setUpLogging() throws IOException {
{
"persistent": {
"logger.org.elasticsearch.xpack.ml.inference": "TRACE",
"logger.org.elasticsearch.xpack.ml.inference.assignments": "DEBUG",
"logger.org.elasticsearch.xpack.ml.process": "DEBUG",
"logger.org.elasticsearch.xpack.ml.action": "TRACE"
}
Expand Down Expand Up @@ -133,7 +135,6 @@ public void testTrainedModelDeployment() throws Exception {
}
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/95501")
public void testTrainedModelDeploymentStopOnMixedCluster() throws Exception {
assumeTrue("NLP model deployments added in 8.0", UPGRADE_FROM_VERSION.onOrAfter(Version.V_8_0_0));

Expand All @@ -157,7 +158,6 @@ public void testTrainedModelDeploymentStopOnMixedCluster() throws Exception {
request.addParameter("timeout", "70s");
}));
assertThatTrainedModelAssignmentMetadataIsEmpty(modelId);

}
default -> throw new UnsupportedOperationException("Unknown cluster type [" + CLUSTER_TYPE + "]");
}
Expand Down Expand Up @@ -263,11 +263,14 @@ private void assertThatTrainedModelAssignmentMetadataIsEmpty(String modelId) thr
"_cluster/state?filter_path=metadata.trained_model_assignment." + modelId
);
Response getTrainedModelAssignmentMetadataResponse = client().performRequest(getTrainedModelAssignmentMetadataRequest);
assertThat(EntityUtils.toString(getTrainedModelAssignmentMetadataResponse.getEntity()), containsString("{}"));
String responseBody = EntityUtils.toString(getTrainedModelAssignmentMetadataResponse.getEntity());
assertThat(responseBody, oneOf("{}", "{\"metadata\":{\"trained_model_assignment\":{}}}"));

// deprecated name
getTrainedModelAssignmentMetadataRequest = new Request("GET", "_cluster/state?filter_path=metadata.trained_model_allocation");
getTrainedModelAssignmentMetadataResponse = client().performRequest(getTrainedModelAssignmentMetadataRequest);
assertThat(EntityUtils.toString(getTrainedModelAssignmentMetadataResponse.getEntity()), equalTo("{}"));
responseBody = EntityUtils.toString(getTrainedModelAssignmentMetadataResponse.getEntity());
assertThat(responseBody, oneOf("{}", "{\"metadata\":{\"trained_model_allocation\":{}}}"));
}

private Response getTrainedModelStats(String modelId) throws IOException {
Expand Down