From 341e2566acbb9b0f43b975cc108af60e5de2b431 Mon Sep 17 00:00:00 2001 From: Mikhail Khludnev Date: Tue, 26 Nov 2024 16:02:37 +0300 Subject: [PATCH] move heavy test to IT Signed-off-by: Mikhail Khludnev --- .../search/fields/SearchIpFieldTermsIT.java} | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) rename server/src/{test/java/org/opensearch/search/SearchIpFieldTermsTests.java => internalClusterTest/java/org/opensearch/search/fields/SearchIpFieldTermsIT.java} (95%) diff --git a/server/src/test/java/org/opensearch/search/SearchIpFieldTermsTests.java b/server/src/internalClusterTest/java/org/opensearch/search/fields/SearchIpFieldTermsIT.java similarity index 95% rename from server/src/test/java/org/opensearch/search/SearchIpFieldTermsTests.java rename to server/src/internalClusterTest/java/org/opensearch/search/fields/SearchIpFieldTermsIT.java index 6fc1864e885c5..cc19e82377b38 100644 --- a/server/src/test/java/org/opensearch/search/SearchIpFieldTermsTests.java +++ b/server/src/internalClusterTest/java/org/opensearch/search/fields/SearchIpFieldTermsIT.java @@ -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; @@ -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 @@ -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);