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 0ecc10c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public void testDataSourceCreationWithDefaultSettings() {
assertDataSourceCount(1);
assertSelectFromDataSourceReturnsSuccess();
assertSelectFromDummyIndexInValidDataSourceDataSourceReturnsDoesNotExist();
deleteSelfDataSourceCreated();
}

@Test
Expand All @@ -52,6 +53,8 @@ public void testAfterPreviousEnable() {
assertDataSourceCount(0);
assertSelectFromDataSourceReturnsDoesNotExist();
assertAsyncQueryApiDisabled();
setDataSourcesEnabled("transient", true);
deleteSelfDataSourceCreated();
}

@SneakyThrows
Expand Down Expand Up @@ -142,4 +145,11 @@ private Response performRequest(Request request) {
return e.getResponse();
}
}

@SneakyThrows
private void deleteSelfDataSourceCreated() {
Request deleteRequest = getDeleteDataSourceRequest("self");
Response deleteResponse = client().performRequest(deleteRequest);
Assert.assertEquals(204, deleteResponse.getStatusLine().getStatusCode());
}
}
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 0ecc10c

Please sign in to comment.