From e1949ee362ea1315ddef31f9be482526b6547580 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Fri, 31 Mar 2017 14:30:44 -0700 Subject: [PATCH] Test: Use separate wrapper tasks for tribe clusters setup (elastic/x-pack-elasticsearch#905) This commit adds separate tasks for tribe clusteres which the cluster formation tasks build their own tasks off. This ensures each cluster will have its own wait task, so that the tribe node will be able to wait on the other clusters being up before even trying to start. relates elastic/x-pack-elasticsearch#877 Original commit: elastic/x-pack-elasticsearch@1e4c729372aeb3758e2a6276a0b00d0f540e1d70 --- qa/tribe-tests-with-license/build.gradle | 9 +++++++-- qa/tribe-tests-with-security/build.gradle | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/qa/tribe-tests-with-license/build.gradle b/qa/tribe-tests-with-license/build.gradle index eb5373abc0a..1dbb32e6513 100644 --- a/qa/tribe-tests-with-license/build.gradle +++ b/qa/tribe-tests-with-license/build.gradle @@ -11,6 +11,7 @@ dependencies { } +task setupClusterOne {} ClusterConfiguration cluster1Config = new ClusterConfiguration(project) cluster1Config.clusterName = 'cluster1' cluster1Config.setting('node.name', 'cluster1-node1') @@ -22,8 +23,9 @@ cluster1Config.setting('xpack.watcher.enabled', false) cluster1Config.setting('xpack.graph.enabled', false) cluster1Config.setting('xpack.ml.enabled', false) -List cluster1Nodes = ClusterFormationTasks.setup(project, 'clusterOne', integTestRunner, cluster1Config) +List cluster1Nodes = ClusterFormationTasks.setup(project, 'clusterOne', setupClusterOne, cluster1Config) +task setupClusterTwo {} ClusterConfiguration cluster2Config = new ClusterConfiguration(project) cluster2Config.clusterName = 'cluster2' cluster2Config.setting('node.name', 'cluster2-node1') @@ -36,7 +38,7 @@ cluster2Config.setting('xpack.watcher.enabled', false) cluster2Config.setting('xpack.graph.enabled', false) cluster2Config.setting('xpack.ml.enabled', false) -List cluster2Nodes = ClusterFormationTasks.setup(project, 'clusterTwo', integTestRunner, cluster2Config) +List cluster2Nodes = ClusterFormationTasks.setup(project, 'clusterTwo', setupClusterTwo, cluster2Config) integTestCluster { setting 'node.name', 'tribe-node' @@ -70,7 +72,10 @@ integTestCluster { } integTestRunner { + dependsOn(setupClusterOne, setupClusterTwo) systemProperty 'tests.cluster', "${-> cluster1Nodes.get(0).transportUri()}" systemProperty 'tests.cluster2', "${-> cluster2Nodes.get(0).transportUri()}" systemProperty 'tests.tribe', "${-> integTest.nodes.get(0).transportUri()}" + finalizedBy 'clusterOne#stop' + finalizedBy 'clusterTwo#stop' } diff --git a/qa/tribe-tests-with-security/build.gradle b/qa/tribe-tests-with-security/build.gradle index 2ac4c61bc7d..0ed5f6c65e6 100644 --- a/qa/tribe-tests-with-security/build.gradle +++ b/qa/tribe-tests-with-security/build.gradle @@ -10,6 +10,7 @@ dependencies { testCompile project(path: ':x-pack-elasticsearch:plugin', configuration: 'testArtifacts') } +task setupClusterOne {} ClusterConfiguration configOne = new ClusterConfiguration(project) configOne.clusterName = 'cluster1' configOne.setting('node.name', 'cluster1-node1') @@ -28,8 +29,9 @@ configOne.waitCondition = { node, ant -> retries: 10) return tmpFile.exists() } -List cluster1Nodes = ClusterFormationTasks.setup(project, 'clusterOne', integTestRunner, configOne) +List cluster1Nodes = ClusterFormationTasks.setup(project, 'clusterOne', setupClusterOne, configOne) +task setupClusterTwo {} ClusterConfiguration configTwo = new ClusterConfiguration(project) configTwo.clusterName = 'cluster2' configTwo.setting('node.name', 'cluster2-node1') @@ -48,7 +50,7 @@ configTwo.waitCondition = { node, ant -> retries: 10) return tmpFile.exists() } -List cluster2Nodes = ClusterFormationTasks.setup(project, 'clusterTwo', integTestRunner, configTwo) +List cluster2Nodes = ClusterFormationTasks.setup(project, 'clusterTwo', setupClusterTwo, configTwo) integTestCluster { plugin ':x-pack-elasticsearch:plugin' @@ -79,7 +81,10 @@ integTestCluster { } integTestRunner { + dependsOn(setupClusterOne, setupClusterTwo) systemProperty 'tests.cluster', "${-> cluster1Nodes.get(0).transportUri()}" systemProperty 'tests.cluster2', "${-> cluster2Nodes.get(0).transportUri()}" systemProperty 'tests.tribe', "${-> integTest.nodes.get(0).transportUri()}" + finalizedBy 'clusterOne#stop' + finalizedBy 'clusterTwo#stop' }