Skip to content

Commit 4bcc961

Browse files
committed
Test: RelocationTests.testMoveShardsWhileRelocation should wait on nodes to start before asking for a client
The client call may create another node if none of the previous nodes are published. That node throws the test off.
1 parent 62d90df commit 4bcc961

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/test/java/org/elasticsearch/recovery/RelocationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,14 +337,14 @@ public void testMoveShardsWhileRelocation() throws Exception {
337337
final String indexName = "test";
338338

339339
ListenableFuture<String> blueFuture = internalCluster().startNodeAsync(ImmutableSettings.builder().put("node.color", "blue").build());
340-
internalCluster().startNodeAsync(ImmutableSettings.builder().put("node.color", "green").build());
341340
ListenableFuture<String> redFuture = internalCluster().startNodeAsync(ImmutableSettings.builder().put("node.color", "red").build());
341+
internalCluster().startNode(ImmutableSettings.builder().put("node.color", "green").build());
342+
final String blueNodeName = blueFuture.get();
343+
final String redNodeName = redFuture.get();
342344

343345
ClusterHealthResponse response = client().admin().cluster().prepareHealth().setWaitForNodes(">=3").get();
344346
assertThat(response.isTimedOut(), is(false));
345347

346-
String blueNodeName = blueFuture.get();
347-
final String redNodeName = redFuture.get();
348348

349349
client().admin().indices().prepareCreate(indexName)
350350
.setSettings(

0 commit comments

Comments
 (0)