Skip to content

Commit

Permalink
Fixed 2.16 integ test failures
Browse files Browse the repository at this point in the history
Signed-off-by: Vamsi Manohar <reddyvam@amazon.com>
  • Loading branch information
vmmusings committed Jul 30, 2024
1 parent 6b8ee3d commit c208d76
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@

import static org.opensearch.sql.legacy.TestUtils.getResponseBody;

import java.io.IOException;
import lombok.SneakyThrows;
import org.json.JSONObject;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Test;
import org.opensearch.client.Request;
Expand All @@ -23,6 +25,13 @@ protected boolean preserveClusterUponCompletion() {
return false;
}

@AfterClass
protected static void deleteSelfDataSourceCreated() throws IOException {
Request deleteRequest = getDeleteDataSourceRequest("self");
Response deleteResponse = client().performRequest(deleteRequest);
Assert.assertEquals(204, deleteResponse.getStatusLine().getStatusCode());
}

@Test
public void testAsyncQueryAPIFailureIfSettingIsDisabled() {
setDataSourcesEnabled("transient", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ protected static void wipeAllOpenSearchIndices(RestClient client) throws IOExcep
try {
// System index, mostly named .opensearch-xxx or .opendistro-xxx, are not allowed to
// delete
if (!indexName.startsWith(".opensearch") && !indexName.startsWith(".opendistro")) {
if (!indexName.startsWith(".opensearch")
&& !indexName.startsWith(".opendistro")
&& !indexName.startsWith(".ql")) {
client.performRequest(new Request("DELETE", "/" + indexName));
}
} catch (Exception e) {
Expand Down

0 comments on commit c208d76

Please sign in to comment.