[TEST] Fix wait condition on testMultipleNodesShutdownNonMasterNodes
After two nodes are being stopped and two more are joining the cluster, we first have to wait on the cluster to consist of the right nodes before
waiting on green status, otherwise we might get a green status for a cluster with dead nodes.
@@ -248,8 +248,8 @@ public class MinimumMasterNodesIT extends ESIntegTestCase {
logger.info("--> start back the 2 nodes ");
String[] newNodes = internalCluster().startNodes(2, settings).stream().toArray(String[]::new);
- ensureGreen();
internalCluster().validateClusterFormed();
+ ensureGreen();
state = client().admin().cluster().prepareState().execute().actionGet().getState();
assertThat(state.nodes().getSize(), equalTo(4));
