Skip to content

Commit 2127336

Browse files
authored
Randomized # of shards (#134330)
1 parent f653a8a commit 2127336

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/RandomizedTimeSeriesIT.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import org.elasticsearch.action.DocWriteRequest;
1212
import org.elasticsearch.action.admin.indices.template.put.TransportPutComposableIndexTemplateAction;
1313
import org.elasticsearch.cluster.metadata.ComposableIndexTemplate;
14+
import org.elasticsearch.cluster.metadata.IndexMetadata;
1415
import org.elasticsearch.common.Strings;
1516
import org.elasticsearch.common.bytes.BytesReference;
1617
import org.elasticsearch.common.compress.CompressedXContent;
@@ -301,6 +302,7 @@ void putTSDBIndexTemplate(List<String> patterns, @Nullable String mappingString)
301302
Settings.Builder settingsBuilder = Settings.builder();
302303
// Ensure it will be a TSDB data stream
303304
settingsBuilder.put(IndexSettings.MODE.getKey(), IndexMode.TIME_SERIES);
305+
settingsBuilder.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, ESTestCase.randomIntBetween(1, 5));
304306
settingsBuilder.put(IndexSettings.TIME_SERIES_START_TIME.getKey(), "2025-07-31T00:00:00Z");
305307
settingsBuilder.put(IndexSettings.TIME_SERIES_END_TIME.getKey(), "2025-07-31T12:00:00Z");
306308
CompressedXContent mappings = mappingString == null ? null : CompressedXContent.fromJSON(mappingString);

0 commit comments

Comments
 (0)