Skip to content

Commit c595a73

Browse files
author
Christoph Büscher
committed
Add test logging for #35644
Adding logging to confirm the suspicion that there might be another old index lingering around in the test cluster in cases where this test occasionally fails.
1 parent a9eccbc commit c595a73

File tree

1 file changed

+8
-0
lines changed
  • client/rest-high-level/src/test/java/org/elasticsearch/client

1 file changed

+8
-0
lines changed

client/rest-high-level/src/test/java/org/elasticsearch/client/SearchIT.java

+8
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,14 @@ public void testCountAllIndicesNoQuery() throws IOException {
12541254
CountRequest countRequest = new CountRequest();
12551255
CountResponse countResponse = execute(countRequest, highLevelClient()::count, highLevelClient()::countAsync);
12561256
assertCountHeader(countResponse);
1257+
// add logging to get more info about why https://github.com/elastic/elasticsearch/issues/35644 is failing
1258+
// TODO remove this once #35644 is fixed
1259+
if (countResponse.getCount() != 12) {
1260+
SearchRequest searchRequest = new SearchRequest();
1261+
searchRequest.source(new SearchSourceBuilder().size(20));
1262+
SearchResponse searchResponse = execute(searchRequest, highLevelClient()::search, highLevelClient()::searchAsync);
1263+
logger.info("Unexpected hit count, was expecting 12 hits but got: " + searchResponse.toString());
1264+
}
12571265
assertEquals(12, countResponse.getCount());
12581266
}
12591267

0 commit comments

Comments
 (0)