Remove http pipelining from integration test case (#30788)

This is related to #29500. We are removing the ability to disable http
pipelining. This PR removes the references to disabling pipelining in
the integration test case.
This commit is contained in:
Tim Brooks 2018-05-22 17:18:05 -06:00 committed by GitHub
parent a5d90e919f
commit 63a5799526
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 22 deletions

View File

@ -150,7 +150,6 @@ public class SingleNodeDiscoveryIT extends ESIntegTestCase {
internalCluster().getClusterName(), internalCluster().getClusterName(),
configurationSource, configurationSource,
0, 0,
false,
"other", "other",
Arrays.asList(getTestTransportPlugin(), MockHttpTransport.TestPlugin.class), Arrays.asList(getTestTransportPlugin(), MockHttpTransport.TestPlugin.class),
Function.identity())) { Function.identity())) {

View File

@ -1829,7 +1829,7 @@ public abstract class ESIntegTestCase extends ESTestCase {
return new InternalTestCluster(seed, createTempDir(), supportsDedicatedMasters, getAutoMinMasterNodes(), return new InternalTestCluster(seed, createTempDir(), supportsDedicatedMasters, getAutoMinMasterNodes(),
minNumDataNodes, maxNumDataNodes, minNumDataNodes, maxNumDataNodes,
InternalTestCluster.clusterName(scope.name(), seed) + "-cluster", nodeConfigurationSource, getNumClientNodes(), InternalTestCluster.clusterName(scope.name(), seed) + "-cluster", nodeConfigurationSource, getNumClientNodes(),
InternalTestCluster.DEFAULT_ENABLE_HTTP_PIPELINING, nodePrefix, mockPlugins, getClientWrapper()); nodePrefix, mockPlugins, getClientWrapper());
} }
protected NodeConfigurationSource getNodeConfigSource() { protected NodeConfigurationSource getNodeConfigSource() {

View File

@ -171,8 +171,6 @@ public final class InternalTestCluster extends TestCluster {
static final int DEFAULT_MIN_NUM_CLIENT_NODES = 0; static final int DEFAULT_MIN_NUM_CLIENT_NODES = 0;
static final int DEFAULT_MAX_NUM_CLIENT_NODES = 1; static final int DEFAULT_MAX_NUM_CLIENT_NODES = 1;
static final boolean DEFAULT_ENABLE_HTTP_PIPELINING = true;
/* sorted map to make traverse order reproducible, concurrent since we do checks on it not within a sync block */ /* sorted map to make traverse order reproducible, concurrent since we do checks on it not within a sync block */
private final NavigableMap<String, NodeAndClient> nodes = new TreeMap<>(); private final NavigableMap<String, NodeAndClient> nodes = new TreeMap<>();
@ -219,7 +217,7 @@ public final class InternalTestCluster extends TestCluster {
public InternalTestCluster(long clusterSeed, Path baseDir, public InternalTestCluster(long clusterSeed, Path baseDir,
boolean randomlyAddDedicatedMasters, boolean randomlyAddDedicatedMasters,
boolean autoManageMinMasterNodes, int minNumDataNodes, int maxNumDataNodes, String clusterName, NodeConfigurationSource nodeConfigurationSource, int numClientNodes, boolean autoManageMinMasterNodes, int minNumDataNodes, int maxNumDataNodes, String clusterName, NodeConfigurationSource nodeConfigurationSource, int numClientNodes,
boolean enableHttpPipelining, String nodePrefix, Collection<Class<? extends Plugin>> mockPlugins, Function<Client, Client> clientWrapper) { String nodePrefix, Collection<Class<? extends Plugin>> mockPlugins, Function<Client, Client> clientWrapper) {
super(clusterSeed); super(clusterSeed);
this.autoManageMinMasterNodes = autoManageMinMasterNodes; this.autoManageMinMasterNodes = autoManageMinMasterNodes;
this.clientWrapper = clientWrapper; this.clientWrapper = clientWrapper;

View File

@ -19,8 +19,6 @@
*/ */
package org.elasticsearch.test.test; package org.elasticsearch.test.test;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.core.internal.io.IOUtils;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
import org.elasticsearch.client.Client; import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.cluster.ClusterName;
@ -28,6 +26,7 @@ import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.network.NetworkModule;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.core.internal.io.IOUtils;
import org.elasticsearch.discovery.DiscoverySettings; import org.elasticsearch.discovery.DiscoverySettings;
import org.elasticsearch.discovery.zen.ZenDiscovery; import org.elasticsearch.discovery.zen.ZenDiscovery;
import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.env.NodeEnvironment;
@ -63,8 +62,6 @@ import static org.elasticsearch.discovery.zen.ElectMasterService.DISCOVERY_ZEN_M
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFileExists; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFileExists;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFileNotExists; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFileNotExists;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.hasEntry;
import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.not;
/** /**
@ -86,16 +83,15 @@ public class InternalTestClusterTests extends ESTestCase {
String clusterName = randomRealisticUnicodeOfCodepointLengthBetween(1, 10); String clusterName = randomRealisticUnicodeOfCodepointLengthBetween(1, 10);
NodeConfigurationSource nodeConfigurationSource = NodeConfigurationSource.EMPTY; NodeConfigurationSource nodeConfigurationSource = NodeConfigurationSource.EMPTY;
int numClientNodes = randomIntBetween(0, 10); int numClientNodes = randomIntBetween(0, 10);
boolean enableHttpPipelining = randomBoolean();
String nodePrefix = randomRealisticUnicodeOfCodepointLengthBetween(1, 10); String nodePrefix = randomRealisticUnicodeOfCodepointLengthBetween(1, 10);
Path baseDir = createTempDir(); Path baseDir = createTempDir();
InternalTestCluster cluster0 = new InternalTestCluster(clusterSeed, baseDir, masterNodes, InternalTestCluster cluster0 = new InternalTestCluster(clusterSeed, baseDir, masterNodes,
randomBoolean(), minNumDataNodes, maxNumDataNodes, clusterName, nodeConfigurationSource, numClientNodes, randomBoolean(), minNumDataNodes, maxNumDataNodes, clusterName, nodeConfigurationSource, numClientNodes,
enableHttpPipelining, nodePrefix, Collections.emptyList(), Function.identity()); nodePrefix, Collections.emptyList(), Function.identity());
InternalTestCluster cluster1 = new InternalTestCluster(clusterSeed, baseDir, masterNodes, InternalTestCluster cluster1 = new InternalTestCluster(clusterSeed, baseDir, masterNodes,
randomBoolean(), minNumDataNodes, maxNumDataNodes, clusterName, nodeConfigurationSource, numClientNodes, randomBoolean(), minNumDataNodes, maxNumDataNodes, clusterName, nodeConfigurationSource, numClientNodes,
enableHttpPipelining, nodePrefix, Collections.emptyList(), Function.identity()); nodePrefix, Collections.emptyList(), Function.identity());
// TODO: this is not ideal - we should have a way to make sure ports are initialized in the same way // TODO: this is not ideal - we should have a way to make sure ports are initialized in the same way
assertClusters(cluster0, cluster1, false); assertClusters(cluster0, cluster1, false);
@ -211,16 +207,15 @@ public class InternalTestClusterTests extends ESTestCase {
} }
}; };
boolean enableHttpPipelining = randomBoolean();
String nodePrefix = "foobar"; String nodePrefix = "foobar";
Path baseDir = createTempDir(); Path baseDir = createTempDir();
InternalTestCluster cluster0 = new InternalTestCluster(clusterSeed, baseDir, masterNodes, InternalTestCluster cluster0 = new InternalTestCluster(clusterSeed, baseDir, masterNodes,
autoManageMinMasterNodes, minNumDataNodes, maxNumDataNodes, clusterName1, nodeConfigurationSource, numClientNodes, autoManageMinMasterNodes, minNumDataNodes, maxNumDataNodes, clusterName1, nodeConfigurationSource, numClientNodes,
enableHttpPipelining, nodePrefix, mockPlugins(), Function.identity()); nodePrefix, mockPlugins(), Function.identity());
InternalTestCluster cluster1 = new InternalTestCluster(clusterSeed, baseDir, masterNodes, InternalTestCluster cluster1 = new InternalTestCluster(clusterSeed, baseDir, masterNodes,
autoManageMinMasterNodes, minNumDataNodes, maxNumDataNodes, clusterName2, nodeConfigurationSource, numClientNodes, autoManageMinMasterNodes, minNumDataNodes, maxNumDataNodes, clusterName2, nodeConfigurationSource, numClientNodes,
enableHttpPipelining, nodePrefix, mockPlugins(), Function.identity()); nodePrefix, mockPlugins(), Function.identity());
assertClusters(cluster0, cluster1, false); assertClusters(cluster0, cluster1, false);
long seed = randomLong(); long seed = randomLong();
@ -280,12 +275,11 @@ public class InternalTestClusterTests extends ESTestCase {
.put(NetworkModule.TRANSPORT_TYPE_KEY, transportClient).build(); .put(NetworkModule.TRANSPORT_TYPE_KEY, transportClient).build();
} }
}; };
boolean enableHttpPipelining = randomBoolean();
String nodePrefix = "test"; String nodePrefix = "test";
Path baseDir = createTempDir(); Path baseDir = createTempDir();
InternalTestCluster cluster = new InternalTestCluster(clusterSeed, baseDir, masterNodes, InternalTestCluster cluster = new InternalTestCluster(clusterSeed, baseDir, masterNodes,
true, minNumDataNodes, maxNumDataNodes, clusterName1, nodeConfigurationSource, numClientNodes, true, minNumDataNodes, maxNumDataNodes, clusterName1, nodeConfigurationSource, numClientNodes,
enableHttpPipelining, nodePrefix, mockPlugins(), Function.identity()); nodePrefix, mockPlugins(), Function.identity());
try { try {
cluster.beforeTest(random(), 0.0); cluster.beforeTest(random(), 0.0);
final int originalMasterCount = cluster.numMasterNodes(); final int originalMasterCount = cluster.numMasterNodes();
@ -390,7 +384,7 @@ public class InternalTestClusterTests extends ESTestCase {
return Settings.builder() return Settings.builder()
.put(NetworkModule.TRANSPORT_TYPE_KEY, transportClient).build(); .put(NetworkModule.TRANSPORT_TYPE_KEY, transportClient).build();
} }
}, 0, randomBoolean(), "", mockPlugins(), Function.identity()); }, 0, "", mockPlugins(), Function.identity());
cluster.beforeTest(random(), 0.0); cluster.beforeTest(random(), 0.0);
List<DiscoveryNode.Role> roles = new ArrayList<>(); List<DiscoveryNode.Role> roles = new ArrayList<>();
for (int i = 0; i < numNodes; i++) { for (int i = 0; i < numNodes; i++) {
@ -473,11 +467,10 @@ public class InternalTestClusterTests extends ESTestCase {
.put(NetworkModule.TRANSPORT_TYPE_KEY, transportClient).build(); .put(NetworkModule.TRANSPORT_TYPE_KEY, transportClient).build();
} }
}; };
boolean enableHttpPipelining = randomBoolean();
String nodePrefix = "test"; String nodePrefix = "test";
Path baseDir = createTempDir(); Path baseDir = createTempDir();
InternalTestCluster cluster = new InternalTestCluster(randomLong(), baseDir, false, true, 2, 2, InternalTestCluster cluster = new InternalTestCluster(randomLong(), baseDir, false, true, 2, 2,
"test", nodeConfigurationSource, 0, enableHttpPipelining, nodePrefix, "test", nodeConfigurationSource, 0, nodePrefix,
mockPlugins(), Function.identity()); mockPlugins(), Function.identity());
try { try {
cluster.beforeTest(random(), 0.0); cluster.beforeTest(random(), 0.0);

View File

@ -214,7 +214,7 @@ public class IndexAuditTrailTests extends SecurityIntegTestCase {
mockPlugins.add(getTestTransportPlugin()); mockPlugins.add(getTestTransportPlugin());
} }
remoteCluster = new InternalTestCluster(randomLong(), createTempDir(), false, true, numNodes, numNodes, cluster2Name, remoteCluster = new InternalTestCluster(randomLong(), createTempDir(), false, true, numNodes, numNodes, cluster2Name,
cluster2SettingsSource, 0, false, SECOND_CLUSTER_NODE_PREFIX, mockPlugins, cluster2SettingsSource, 0, SECOND_CLUSTER_NODE_PREFIX, mockPlugins,
useSecurity ? getClientWrapper() : Function.identity()); useSecurity ? getClientWrapper() : Function.identity());
remoteCluster.beforeTest(random(), 0.5); remoteCluster.beforeTest(random(), 0.5);

View File

@ -117,7 +117,7 @@ public class RemoteIndexAuditTrailStartingTests extends SecurityIntegTestCase {
} }
}; };
remoteCluster = new InternalTestCluster(randomLong(), createTempDir(), false, true, numNodes, numNodes, remoteCluster = new InternalTestCluster(randomLong(), createTempDir(), false, true, numNodes, numNodes,
cluster2Name, cluster2SettingsSource, 0, false, SECOND_CLUSTER_NODE_PREFIX, getMockPlugins(), getClientWrapper()); cluster2Name, cluster2SettingsSource, 0, SECOND_CLUSTER_NODE_PREFIX, getMockPlugins(), getClientWrapper());
remoteCluster.beforeTest(random(), 0.0); remoteCluster.beforeTest(random(), 0.0);
assertNoTimeout(remoteCluster.client().admin().cluster().prepareHealth().setWaitForGreenStatus().get()); assertNoTimeout(remoteCluster.client().admin().cluster().prepareHealth().setWaitForGreenStatus().get());
} }