Skip to content

Commit 103c416

Browse files
authored
Fixed 2.16 integ test failures (#2871)
Signed-off-by: Vamsi Manohar <[email protected]>
1 parent ba82e12 commit 103c416

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

integ-test/src/test/java/org/opensearch/sql/datasource/DataSourceEnabledIT.java

+10
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public void testDataSourceCreationWithDefaultSettings() {
3838
assertDataSourceCount(1);
3939
assertSelectFromDataSourceReturnsSuccess();
4040
assertSelectFromDummyIndexInValidDataSourceDataSourceReturnsDoesNotExist();
41+
deleteSelfDataSourceCreated();
4142
}
4243

4344
@Test
@@ -52,6 +53,8 @@ public void testAfterPreviousEnable() {
5253
assertDataSourceCount(0);
5354
assertSelectFromDataSourceReturnsDoesNotExist();
5455
assertAsyncQueryApiDisabled();
56+
setDataSourcesEnabled("transient", true);
57+
deleteSelfDataSourceCreated();
5558
}
5659

5760
@SneakyThrows
@@ -142,4 +145,11 @@ private Response performRequest(Request request) {
142145
return e.getResponse();
143146
}
144147
}
148+
149+
@SneakyThrows
150+
private void deleteSelfDataSourceCreated() {
151+
Request deleteRequest = getDeleteDataSourceRequest("self");
152+
Response deleteResponse = client().performRequest(deleteRequest);
153+
Assert.assertEquals(204, deleteResponse.getStatusLine().getStatusCode());
154+
}
145155
}

integ-test/src/test/java/org/opensearch/sql/legacy/OpenSearchSQLRestTestCase.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ protected static void wipeAllOpenSearchIndices(RestClient client) throws IOExcep
195195
try {
196196
// System index, mostly named .opensearch-xxx or .opendistro-xxx, are not allowed to
197197
// delete
198-
if (!indexName.startsWith(".opensearch") && !indexName.startsWith(".opendistro")) {
198+
if (!indexName.startsWith(".opensearch")
199+
&& !indexName.startsWith(".opendistro")
200+
&& !indexName.startsWith(".ql")) {
199201
client.performRequest(new Request("DELETE", "/" + indexName));
200202
}
201203
} catch (Exception e) {

0 commit comments

Comments
 (0)