Skip to content

Commit

Permalink
Avoid size=0 for terminate_after tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Deng <[email protected]>
  • Loading branch information
jed326 authored and Jay Deng committed Oct 6, 2023
1 parent dad525a commit 34b21af
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ public void testSimpleTerminateAfterCount() throws Exception {
SearchResponse searchResponse;
int size;
for (int i = 1; i < max; i++) {
size = randomIntBetween(0, max);
// Size=0 has known issues, see https://github.com/opensearch-project/OpenSearch/issues/10435
size = randomIntBetween(1, max);
searchResponse = client().prepareSearch("test")
.setQuery(QueryBuilders.rangeQuery("field").gte(1).lte(max))
.setTerminateAfter(i)
Expand Down Expand Up @@ -337,8 +338,9 @@ public void testSimpleTerminateAfterTrackTotalHitsUpTo() throws Exception {
ensureGreen();
refresh();

// size=0 is a special case where topDocsCollector is not added
int size = randomIntBetween(0, 1);
// Size=0 is a special case where topDocsCollector is not added
// Size=0 has known issues, see https://github.com/opensearch-project/OpenSearch/issues/10435
int size = 1;
SearchResponse searchResponse;
searchResponse = client().prepareSearch("test")
.setQuery(QueryBuilders.rangeQuery("field").gte(1).lte(numDocs))
Expand Down

0 comments on commit 34b21af

Please sign in to comment.