Skip to content

Commit

Permalink
Disable index refresh for TermsFixedDocCountErrorIT (opensearch-proje…
Browse files Browse the repository at this point in the history
…ct#11976)

Signed-off-by: Jay Deng <[email protected]>
Signed-off-by: Shivansh Arora <[email protected]>
  • Loading branch information
jed326 authored and shiv0408 committed Apr 25, 2024
1 parent 9faa522 commit 252db84
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 252db84

Please sign in to comment.