Skip to content

Commit

Permalink
move heavy test to IT
Browse files Browse the repository at this point in the history
Signed-off-by: Mikhail Khludnev <mkhl@apache.org>
  • Loading branch information
mkhludnev committed Nov 26, 2024
1 parent 5ff6d11 commit 341e256
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.search;
package org.opensearch.search.fields;

import org.apache.lucene.search.IndexSearcher;
import org.opensearch.action.bulk.BulkRequestBuilder;
Expand Down Expand Up @@ -35,7 +35,7 @@
import static org.opensearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE;
import static org.hamcrest.Matchers.equalTo;

public class SearchIpFieldTermsTests extends OpenSearchSingleNodeTestCase {
public class SearchIpFieldTermsIT extends OpenSearchSingleNodeTestCase {

/**
* @return number of expected matches
Expand Down Expand Up @@ -111,11 +111,15 @@ public void testLessThanMaxClauses() throws IOException {
assertTermsHitCount(indexName, "addr.dv", toQuery, expectMatches);
// passing dummy filter crushes on rewriting
try {
assertTermsHitCount(indexName, "addr.dv", toQuery, expectMatches, (boolBuilder) -> {
boolBuilder.filter(QueryBuilders.termsQuery("dummy_filter", "1", "2", "3"))
assertTermsHitCount(
indexName,
"addr.dv",
toQuery,
expectMatches,
(boolBuilder) -> boolBuilder.filter(QueryBuilders.termsQuery("dummy_filter", "1", "2", "3"))
.filter(QueryBuilders.termsQuery("dummy_filter", "1", "2", "3", "4"))
.filter(QueryBuilders.termsQuery("dummy_filter", "1", "2", "3", "4", "5"));
});
.filter(QueryBuilders.termsQuery("dummy_filter", "1", "2", "3", "4", "5"))
);
fail();
} catch (SearchPhaseExecutionException ose) {
assertTrue("exceeding on query rewrite", ose.shardFailures()[0].getCause() instanceof IndexSearcher.TooManyNestedClauses);
Expand Down

0 comments on commit 341e256

Please sign in to comment.