From ed5b49a5be2325c576fdf08de5aaaa579684ed52 Mon Sep 17 00:00:00 2001 From: javanna Date: Sat, 7 Jun 2014 15:29:41 +0200 Subject: [PATCH] [TEST] Added backwards compatibility check to control whether to enable client nodes or not within TestCluster Our REST backwards compatibility tests need to be able to disable client nodes within the TestCluster when running older tests that assume client nodes are not around. --- .../elasticsearch/test/ElasticsearchIntegrationTest.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/elasticsearch/test/ElasticsearchIntegrationTest.java b/src/test/java/org/elasticsearch/test/ElasticsearchIntegrationTest.java index 37ba4eaa290..75aa45ef9da 100644 --- a/src/test/java/org/elasticsearch/test/ElasticsearchIntegrationTest.java +++ b/src/test/java/org/elasticsearch/test/ElasticsearchIntegrationTest.java @@ -260,7 +260,14 @@ public abstract class ElasticsearchIntegrationTest extends ElasticsearchTestCase GLOBAL_CLUSTER = new ExternalTestCluster(transportAddresses); } else { long masterSeed = SeedUtils.parseSeed(RandomizedContext.current().getRunnerSeedAsString()); - GLOBAL_CLUSTER = new TestCluster(masterSeed, clusterName("shared", ElasticsearchTestCase.CHILD_VM_ID, masterSeed)); + int numClientNodes; + if (COMPATIBILITY_VERSION.before(Version.V_1_2_0)) { + numClientNodes = 0; + } else { + numClientNodes = TestCluster.DEFAULT_NUM_CLIENT_NODES; + } + GLOBAL_CLUSTER = new TestCluster(masterSeed, TestCluster.DEFAULT_MIN_NUM_DATA_NODES, TestCluster.DEFAULT_MAX_NUM_DATA_NODES, + clusterName("shared", ElasticsearchTestCase.CHILD_VM_ID, masterSeed), numClientNodes, TestCluster.DEFAULT_ENABLE_RANDOM_BENCH_NODES); } } }