Skip to content

Commit abc660f

Browse files
authored
Ensure enough nodes in WriteLoadForeacasterIT (#134132)
These tests would sometimes create 1-replica indices in a 1-node cluster which will never reach `green` health. This commit ensures there are enough nodes to allocate all the shards. Closes #133455 Closes #134124 Closes #134123
1 parent 3ab03b7 commit abc660f

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

muted-tests.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -516,12 +516,6 @@ tests:
516516
- class: org.elasticsearch.xpack.esql.ccq.MultiClusterSpecIT
517517
method: test {csv-spec:spatial.ConvertFromStringParseError}
518518
issue: https://github.com/elastic/elasticsearch/issues/134104
519-
- class: org.elasticsearch.xpack.writeloadforecaster.WriteLoadForecasterIT
520-
method: testWriteLoadForecastIsOverriddenBySetting
521-
issue: https://github.com/elastic/elasticsearch/issues/133455
522-
- class: org.elasticsearch.xpack.writeloadforecaster.WriteLoadForecasterIT
523-
method: testWriteLoadForecastDoesNotGetPopulatedWithInvalidLicense
524-
issue: https://github.com/elastic/elasticsearch/issues/134124
525519
- class: org.elasticsearch.xpack.esql.ccq.MultiClusterSpecIT
526520
method: test {csv-spec:fork.ForkWithMixOfCommands}
527521
issue: https://github.com/elastic/elasticsearch/issues/134135

x-pack/plugin/write-load-forecaster/src/internalClusterTest/java/org/elasticsearch/xpack/writeloadforecaster/WriteLoadForecasterIT.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ private void setUpDataStreamWriteDocsAndRollover(String dataStreamName) throws E
145145
private void setUpDataStreamWriteDocsAndRollover(String dataStreamName, Settings extraIndexTemplateSettings) throws Exception {
146146
final int numberOfShards = randomIntBetween(1, 5);
147147
final int numberOfReplicas = randomIntBetween(0, 1);
148+
internalCluster().ensureAtLeastNumDataNodes(numberOfReplicas + 1);
149+
148150
final Settings indexSettings = Settings.builder()
149151
.put(extraIndexTemplateSettings)
150152
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, numberOfShards)

0 commit comments

Comments
 (0)