Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <[email protected]>
  • Loading branch information
Hailong-am committed May 7, 2024
1 parent f82e148 commit 80b5687
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.Optional;
import java.util.stream.Collectors;

import lombok.extern.log4j.Log4j2;
import org.apache.hc.core5.http.ParseException;
import org.junit.After;
import org.opensearch.client.Request;
Expand All @@ -29,6 +30,7 @@
import org.opensearch.ml.common.output.model.ModelTensors;
import org.opensearch.ml.utils.TestHelper;

@Log4j2
public abstract class RestBaseAgentToolsIT extends MLCommonsRestTestCase {

private static final String INTERNAL_INDICES_PREFIX = ".";
Expand Down Expand Up @@ -87,6 +89,7 @@ protected String executeAgent(String agentId, String requestBody) throws IOExcep

@After
public void deleteExternalIndices() throws IOException {
log.info("deleteExternalIndices");
final Response response = client().performRequest(new Request("GET", "/_cat/indices?format=json" + "&expand_wildcards=all"));
final MediaType xContentType = MediaType.fromMediaType(response.getEntity().getContentType());
try (
Expand All @@ -113,6 +116,7 @@ public void deleteExternalIndices() throws IOException {
.filter(indexName -> !indexName.startsWith(INTERNAL_INDICES_PREFIX))
.collect(Collectors.toList());

log.info("externalIndices{}", String.join(",", externalIndices));
for (final String indexName : externalIndices) {
adminClient().performRequest(new Request("DELETE", "/" + indexName));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,19 @@ public void setupTestChatAgent() throws IOException, InterruptedException {

@After
public void cleanUpClusterSetting() throws IOException {
log.info("cleanUpClusterSetting");
restoreClusterSettings();
}

@After
public void stopMockLLM() {
log.info("stopMockLLM");
server.stop(1);
}

@After
public void deleteModel() throws IOException {
log.info("deleteModel");
undeployModel(modelId);
deleteModel(client(), modelId, null);
}
Expand Down

0 comments on commit 80b5687

Please sign in to comment.