Skip to content

Commit 99798d5

Browse files
authored
[ML] Need to wait for shards to replicate in distributed test (#35541)
Because the cluster was expanded from 1 node to 3 indices would initially start off with 0 replicas. If the original node was killed before auto-expansion to 1 replica was complete then the test would fail because the indices would be unavailable.
1 parent 64ba62a commit 99798d5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/integration/MlDistributedFailureIT.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ public void testJobRelocationIsMemoryAware() throws Exception {
201201
internalCluster().ensureAtLeastNumDataNodes(3);
202202
ensureStableClusterOnAllNodes(3);
203203

204+
// Wait for the cluster to be green - this means the indices have been replicated.
205+
206+
ensureGreen(".ml-config", ".ml-anomalies-shared", ".ml-notifications");
207+
204208
// Open a big job. This should go on a different node to the 4 small ones.
205209

206210
setupJobWithoutDatafeed("big1", new ByteSizeValue(500, ByteSizeUnit.MB));

0 commit comments

Comments
 (0)