Skip to content

Commit d950313

Browse files
committed
hidden pattern test case
1 parent 093503c commit d950313

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/plugin/IndexResolutionIT.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,11 @@ public void testHiddenIndices() {
146146
}
147147
try (var response = run(syncEsqlQueryRequest().query("FROM *-index-1"))) {
148148
assertOk(response);
149-
assertResultCount(response, 10); // only non hidden index matches
149+
assertResultCount(response, 10); // only non-hidden index matches when specifying pattern
150+
}
151+
try (var response = run(syncEsqlQueryRequest().query("FROM .hidden-*"))) {
152+
assertOk(response);
153+
assertResultCount(response, 15); // hidden indices do match when specifying hidden/dot pattern
150154
}
151155
}
152156

@@ -171,9 +175,7 @@ private static void assertOk(EsqlQueryResponse response) {
171175

172176
private static void assertResultCount(EsqlQueryResponse response, long rows) {
173177
long count = 0;
174-
var iterator = response.column(0);
175-
while (iterator.hasNext()) {
176-
iterator.next();
178+
for (var iterator = response.column(0); iterator.hasNext(); iterator.next()) {
177179
count++;
178180
}
179181
assertThat(count, equalTo(rows));

0 commit comments

Comments
 (0)