Skip to content

Commit f506ac4

Browse files
committed
Ensure enough nodes in WriteLoadForecasterIT
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 elastic#133455 Closes elastic#134124 Closes elastic#134123 Backport of elastic#134132 to `9.1`
1 parent 6824dbf commit f506ac4

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,6 @@ tests:
449449
- class: org.elasticsearch.xpack.kql.parser.KqlParserBooleanQueryTests
450450
method: testParseOrQuery
451451
issue: https://github.com/elastic/elasticsearch/issues/133863
452-
- class: org.elasticsearch.xpack.writeloadforecaster.WriteLoadForecasterIT
453-
method: testWriteLoadForecastGetsPopulatedDuringRollovers
454-
issue: https://github.com/elastic/elasticsearch/issues/134123
455452

456453
# Examples:
457454
#

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)