Skip to content

Commit

Permalink
Disable index refresh for TermsFixedDocCountErrorIT (#11976)
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Deng <[email protected]>
(cherry picked from commit 30aa8be)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Jan 23, 2024
1 parent c10d7ce commit 49a097f
Showing 1 changed file with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.Collection;

import static org.opensearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.opensearch.index.IndexSettings.MINIMUM_REFRESH_INTERVAL;
import static org.opensearch.search.SearchService.CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING;
import static org.opensearch.search.aggregations.AggregationBuilders.terms;
import static org.opensearch.test.OpenSearchIntegTestCase.Scope.TEST;
Expand Down Expand Up @@ -71,7 +72,10 @@ public void testSimpleAggErrorMultiShard() throws Exception {
assertAcked(
prepareCreate("idx_mshard_1").setMapping(STRING_FIELD_NAME, "type=keyword")
.setSettings(
Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1).put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)
Settings.builder()
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1)
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)
.put("index.refresh_interval", MINIMUM_REFRESH_INTERVAL)
)
);
client().prepareIndex("idx_mshard_1").setSource(jsonBuilder().startObject().field(STRING_FIELD_NAME, "A").endObject()).get();
Expand All @@ -89,7 +93,10 @@ public void testSimpleAggErrorMultiShard() throws Exception {
assertAcked(
prepareCreate("idx_mshard_2").setMapping(STRING_FIELD_NAME, "type=keyword")
.setSettings(
Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1).put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)
Settings.builder()
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1)
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)
.put("index.refresh_interval", MINIMUM_REFRESH_INTERVAL)
)
);
client().prepareIndex("idx_mshard_2").setSource(jsonBuilder().startObject().field(STRING_FIELD_NAME, "A").endObject()).get();
Expand Down Expand Up @@ -127,7 +134,10 @@ public void testSimpleAggErrorSingleShard() throws Exception {
assertAcked(
prepareCreate("idx_shard_error").setMapping(STRING_FIELD_NAME, "type=keyword")
.setSettings(
Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1).put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)
Settings.builder()
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1)
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)
.put("index.refresh_interval", MINIMUM_REFRESH_INTERVAL)
)
);
client().prepareIndex("idx_shard_error").setSource(jsonBuilder().startObject().field(STRING_FIELD_NAME, "A").endObject()).get();
Expand Down Expand Up @@ -170,7 +180,10 @@ public void testSliceLevelDocCountErrorSingleShard() throws Exception {
assertAcked(
prepareCreate("idx_slice_error").setMapping(STRING_FIELD_NAME, "type=keyword")
.setSettings(
Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1).put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)
Settings.builder()
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1)
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)
.put("index.refresh_interval", MINIMUM_REFRESH_INTERVAL)
)
);
client().prepareIndex("idx_slice_error").setSource(jsonBuilder().startObject().field(STRING_FIELD_NAME, "A").endObject()).get();
Expand Down Expand Up @@ -248,7 +261,10 @@ public void testSliceLevelDocCountErrorMultiShard() throws Exception {
assertAcked(
prepareCreate("idx_mshard_1").setMapping(STRING_FIELD_NAME, "type=keyword")
.setSettings(
Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1).put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)
Settings.builder()
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1)
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)
.put("index.refresh_interval", MINIMUM_REFRESH_INTERVAL)
)
);
client().prepareIndex("idx_mshard_1").setSource(jsonBuilder().startObject().field(STRING_FIELD_NAME, "A").endObject()).get();
Expand Down Expand Up @@ -288,7 +304,10 @@ public void testSliceLevelDocCountErrorMultiShard() throws Exception {
assertAcked(
prepareCreate("idx_mshard_2").setMapping(STRING_FIELD_NAME, "type=keyword")
.setSettings(
Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1).put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)
Settings.builder()
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1)
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)
.put("index.refresh_interval", MINIMUM_REFRESH_INTERVAL)
)
);
client().prepareIndex("idx_mshard_2").setSource(jsonBuilder().startObject().field(STRING_FIELD_NAME, "A").endObject()).get();
Expand Down

0 comments on commit 49a097f

Please sign in to comment.