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@1e4c729372
This commit is contained in:
parent
16d963b8e3
commit
e1949ee362
|
@ -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<NodeInfo> cluster1Nodes = ClusterFormationTasks.setup(project, 'clusterOne', integTestRunner, cluster1Config)
|
||||
List<NodeInfo> 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<NodeInfo> cluster2Nodes = ClusterFormationTasks.setup(project, 'clusterTwo', integTestRunner, cluster2Config)
|
||||
List<NodeInfo> 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'
|
||||
}
|
||||
|
|
|
@ -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<NodeInfo> cluster1Nodes = ClusterFormationTasks.setup(project, 'clusterOne', integTestRunner, configOne)
|
||||
List<NodeInfo> 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<NodeInfo> cluster2Nodes = ClusterFormationTasks.setup(project, 'clusterTwo', integTestRunner, configTwo)
|
||||
List<NodeInfo> 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'
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue