From 80b56877cf1b293f2897985a5e31d1b536d6ef7b Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Tue, 7 May 2024 10:50:34 +0800 Subject: [PATCH] test Signed-off-by: Hailong Cui --- .../java/org/opensearch/ml/rest/RestBaseAgentToolsIT.java | 4 ++++ .../org/opensearch/ml/tools/ToolIntegrationWithLLMTest.java | 3 +++ 2 files changed, 7 insertions(+) diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestBaseAgentToolsIT.java b/plugin/src/test/java/org/opensearch/ml/rest/RestBaseAgentToolsIT.java index 155992a41b..6affa4b868 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestBaseAgentToolsIT.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestBaseAgentToolsIT.java @@ -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; @@ -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 = "."; @@ -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 ( @@ -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)); } diff --git a/plugin/src/test/java/org/opensearch/ml/tools/ToolIntegrationWithLLMTest.java b/plugin/src/test/java/org/opensearch/ml/tools/ToolIntegrationWithLLMTest.java index 0caf7e964c..02b3a2450a 100644 --- a/plugin/src/test/java/org/opensearch/ml/tools/ToolIntegrationWithLLMTest.java +++ b/plugin/src/test/java/org/opensearch/ml/tools/ToolIntegrationWithLLMTest.java @@ -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); }