Avoid shutting down the only master (#36272)
Today the InternalTestClusterTests sometimes set up a cluster with a single master, start some other ndoes, shut the original master down, and then reset the cluster. This doesn't really work, because the original master may be stale. This change avoids shutting down the only master in this situation.
This commit is contained in:
parent
38d2c093ad
commit
38ab15c6fb
|
@ -300,7 +300,8 @@ public class InternalTestClusterTests extends ESTestCase {
|
|||
for (String name: cluster.getNodeNames()) {
|
||||
shardNodePaths.put(name, getNodePaths(cluster, name));
|
||||
}
|
||||
String poorNode = randomFrom(cluster.getNodeNames());
|
||||
String poorNode = randomValueOtherThanMany(n -> originalMasterCount == 1 && n.equals(cluster.getMasterName()),
|
||||
() -> randomFrom(cluster.getNodeNames()));
|
||||
Path dataPath = getNodePaths(cluster, poorNode)[0];
|
||||
final Path testMarker = dataPath.resolve("testMarker");
|
||||
Files.createDirectories(testMarker);
|
||||
|
|
Loading…
Reference in New Issue