Skip to content

Commit

Permalink
Remove some leftover refs to minimum_master_nodes (#42700)
Browse files Browse the repository at this point in the history
Today `InternalTestCluster` has a few vestigial mentions of the
`minimum_master_nodes` setting. This commit removes them and simplifies some of
the surrounding logic.
  • Loading branch information
DaveCTurner authored and mayya-sharipova committed Jun 7, 2019
1 parent 54b21d9 commit 064d58b
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 79 deletions.
Expand Up @@ -47,7 +47,7 @@
// These tests are here today so they have access to a proper REST client. They cannot be in :server:integTest since the REST client needs a
// proper transport implementation, and they cannot be REST tests today since they need to restart nodes. When #35599 and friends land we
// should be able to move these tests to run against a proper cluster instead. TODO do this.
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0, autoMinMasterNodes = false)
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0, autoManageMasterNodes = false)
public class Zen2RestApiIT extends ESNetty4IntegTestCase {

@Override
Expand Down
Expand Up @@ -30,7 +30,7 @@
import java.io.IOException;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertThrows;

@ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0, numClientNodes = 0, autoMinMasterNodes = false)
@ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0, numClientNodes = 0, autoManageMasterNodes = false)
public class IndicesExistsIT extends ESIntegTestCase {

public void testIndexExistsWithBlocksInPlace() throws IOException {
Expand Down
Expand Up @@ -39,7 +39,7 @@

import static org.hamcrest.Matchers.equalTo;

@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0, autoMinMasterNodes = false)
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0, autoManageMasterNodes = false)
public class IndexingMasterFailoverIT extends ESIntegTestCase {

@Override
Expand Down
Expand Up @@ -62,7 +62,7 @@
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;

@ClusterScope(scope = Scope.TEST, numDataNodes = 0, autoMinMasterNodes = false)
@ClusterScope(scope = Scope.TEST, numDataNodes = 0, autoManageMasterNodes = false)
@TestLogging("_root:DEBUG,org.elasticsearch.cluster.service:TRACE,org.elasticsearch.cluster.coordination:TRACE")
public class MinimumMasterNodesIT extends ESIntegTestCase {

Expand Down
Expand Up @@ -39,7 +39,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.nullValue;

@ClusterScope(scope = Scope.TEST, numDataNodes = 0, autoMinMasterNodes = false)
@ClusterScope(scope = Scope.TEST, numDataNodes = 0, autoManageMasterNodes = false)
@TestLogging("_root:DEBUG,org.elasticsearch.action.admin.cluster.state:TRACE")
public class SpecificMasterNodesIT extends ESIntegTestCase {

Expand Down
Expand Up @@ -52,7 +52,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;

@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0, autoMinMasterNodes = false)
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0, autoManageMasterNodes = false)
@TestLogging("_root:DEBUG,org.elasticsearch.cluster.service:TRACE,org.elasticsearch.cluster.coordination:TRACE")
public class UnsafeBootstrapAndDetachCommandIT extends ESIntegTestCase {

Expand Down
Expand Up @@ -50,7 +50,7 @@
numDataNodes = 1,
numClientNodes = 0,
supportsDedicatedMasters = false,
autoMinMasterNodes = false)
autoManageMasterNodes = false)
public class SingleNodeDiscoveryIT extends ESIntegTestCase {

@Override
Expand Down
Expand Up @@ -34,7 +34,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItem;

@ClusterScope(scope = Scope.TEST, numDataNodes = 0, autoMinMasterNodes = false)
@ClusterScope(scope = Scope.TEST, numDataNodes = 0, autoManageMasterNodes = false)
public class RecoverAfterNodesIT extends ESIntegTestCase {
private static final TimeValue BLOCK_WAIT_TIMEOUT = TimeValue.timeValueSeconds(10);

Expand Down
Expand Up @@ -1608,9 +1608,10 @@ public enum Scope {
boolean supportsDedicatedMasters() default true;

/**
* The cluster automatically manages the bootstrap voting configuration. Set this to false to manage the setting manually.
* Indicates whether the cluster automatically manages cluster bootstrapping and the removal of any master-eligible nodes. If
* set to {@code false} then the tests must manage these processes explicitly.
*/
boolean autoMinMasterNodes() default true;
boolean autoManageMasterNodes() default true;

/**
* Returns the number of client nodes in the cluster. Default is {@link InternalTestCluster#DEFAULT_NUM_CLIENT_NODES}, a
Expand Down Expand Up @@ -1698,9 +1699,9 @@ private boolean getSupportsDedicatedMasters() {
return annotation == null ? true : annotation.supportsDedicatedMasters();
}

private boolean getAutoMinMasterNodes() {
private boolean getAutoManageMasterNodes() {
ClusterScope annotation = getAnnotation(this.getClass(), ClusterScope.class);
return annotation == null ? true : annotation.autoMinMasterNodes();
return annotation == null ? true : annotation.autoManageMasterNodes();
}

private int getNumDataNodes() {
Expand Down Expand Up @@ -1838,7 +1839,7 @@ protected TestCluster buildTestCluster(Scope scope, long seed) throws IOExceptio
}
mockPlugins = mocks;
}
return new InternalTestCluster(seed, createTempDir(), supportsDedicatedMasters, getAutoMinMasterNodes(),
return new InternalTestCluster(seed, createTempDir(), supportsDedicatedMasters, getAutoManageMasterNodes(),
minNumDataNodes, maxNumDataNodes,
InternalTestCluster.clusterName(scope.name(), seed) + "-cluster", nodeConfigurationSource, getNumClientNodes(),
nodePrefix, mockPlugins, getClientWrapper(), forbidPrivateIndexSettings());
Expand Down

0 comments on commit 064d58b

Please sign in to comment.