Skip to content

Commit 88a6827

Browse files
authored
Fix and unmute tests in DataStreamIndexSettingsProviderTests (#136162)
1 parent 0b3d23a commit 88a6827

File tree

2 files changed

+10
-18
lines changed

2 files changed

+10
-18
lines changed

modules/data-streams/src/test/java/org/elasticsearch/datastreams/DataStreamIndexSettingsProviderTests.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ public void testGetAdditionalIndexSettings() throws Exception {
7171
String dataStreamName = "logs-app1";
7272

7373
Instant now = Instant.now().truncatedTo(ChronoUnit.SECONDS);
74-
Settings settings = Settings.EMPTY;
74+
Settings settings = Settings.builder()
75+
.put("index.dimensions_tsid_strategy_enabled", indexDimensionsTsidStrategyEnabledSetting)
76+
.build();
7577
String mapping = """
7678
{
7779
"_doc": {
@@ -117,11 +119,8 @@ public void testGetAdditionalIndexSettings() throws Exception {
117119
Settings result = additionalSettings.build();
118120
// The index.time_series.end_time setting requires index.mode to be set to time_series adding it here so that we read this setting:
119121
// (in production the index.mode setting is usually provided in an index or component template)
120-
result = builder().put(result)
121-
.put("index.mode", "time_series")
122-
.put("index.dimensions_tsid_strategy_enabled", indexDimensionsTsidStrategyEnabledSetting)
123-
.build();
124-
assertThat(result.size(), equalTo(5));
122+
result = builder().put(result).put("index.mode", "time_series").build();
123+
assertThat(result.size(), equalTo(4));
125124
assertThat(IndexSettings.MODE.get(result), equalTo(IndexMode.TIME_SERIES));
126125
assertThat(IndexSettings.TIME_SERIES_START_TIME.get(result), equalTo(now.minusMillis(DEFAULT_LOOK_BACK_TIME.getMillis())));
127126
assertThat(IndexSettings.TIME_SERIES_END_TIME.get(result), equalTo(now.plusMillis(DEFAULT_LOOK_AHEAD_TIME.getMillis())));
@@ -187,7 +186,9 @@ public void testGetAdditionalIndexSettingsMappingsMerging() throws Exception {
187186
String dataStreamName = "logs-app1";
188187

189188
Instant now = Instant.now().truncatedTo(ChronoUnit.SECONDS);
190-
Settings settings = Settings.EMPTY;
189+
Settings settings = Settings.builder()
190+
.put("index.dimensions_tsid_strategy_enabled", indexDimensionsTsidStrategyEnabledSetting)
191+
.build();
191192
String mapping1 = """
192193
{
193194
"_doc": {
@@ -249,11 +250,8 @@ public void testGetAdditionalIndexSettingsMappingsMerging() throws Exception {
249250
Settings result = additionalSettings.build();
250251
// The index.time_series.end_time setting requires index.mode to be set to time_series adding it here so that we read this setting:
251252
// (in production the index.mode setting is usually provided in an index or component template)
252-
result = builder().put(result)
253-
.put("index.mode", "time_series")
254-
.put("index.dimensions_tsid_strategy_enabled", indexDimensionsTsidStrategyEnabledSetting)
255-
.build();
256-
assertThat(result.size(), equalTo(5));
253+
result = builder().put(result).put("index.mode", "time_series").build();
254+
assertThat(result.size(), equalTo(4));
257255
assertThat(IndexSettings.MODE.get(result), equalTo(IndexMode.TIME_SERIES));
258256
assertThat(IndexSettings.TIME_SERIES_START_TIME.get(result), equalTo(now.minusMillis(DEFAULT_LOOK_BACK_TIME.getMillis())));
259257
assertThat(IndexSettings.TIME_SERIES_END_TIME.get(result), equalTo(now.plusMillis(DEFAULT_LOOK_AHEAD_TIME.getMillis())));

muted-tests.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -612,15 +612,9 @@ tests:
612612
- class: org.elasticsearch.xpack.esql.action.CrossClusterQueryWithPartialResultsIT
613613
method: testOneRemoteClusterPartial
614614
issue: https://github.com/elastic/elasticsearch/issues/124055
615-
- class: org.elasticsearch.datastreams.DataStreamIndexSettingsProviderTests
616-
method: testGetAdditionalIndexSettingsMappingsMerging
617-
issue: https://github.com/elastic/elasticsearch/issues/135884
618615
- class: org.elasticsearch.xpack.esql.action.EsqlActionBreakerIT
619616
method: testTopNPushedToLuceneOnSortedIndex
620617
issue: https://github.com/elastic/elasticsearch/issues/135939
621-
- class: org.elasticsearch.datastreams.DataStreamIndexSettingsProviderTests
622-
method: testGetAdditionalIndexSettings
623-
issue: https://github.com/elastic/elasticsearch/issues/135972
624618
- class: org.elasticsearch.test.rest.ClientYamlTestSuiteIT
625619
method: test {yaml=indices.get_sample/10_basic/Test get sample for index with no sample config}
626620
issue: https://github.com/elastic/elasticsearch/issues/135975

0 commit comments

Comments
 (0)