Browse Source

Removes stopNodeUponCompletion in favor of moving the stop
nodes task to the final part of the cluster test task execution
graph.

Ali Beyad 9 years ago
parent
commit
83adc87015

+ 0 - 8
buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterConfiguration.groovy

@@ -62,14 +62,6 @@ class ClusterConfiguration {
     @Input
     boolean debug = false
 
-    /**
-     * Whether to stop the nodes in the cluster upon task completion. The only reason to
-     * set this to false is if you want the nodes in the cluster to hang around and you
-     * will clean them up later by calling the `taskName#nodeX.stop` task explicitly.
-     */
-    @Input
-    boolean stopNodesOnCompletion = true
-
     @Input
     String jvmArgs = "-Xms" + System.getProperty('tests.heap.size', '512m') +
             " " + "-Xmx" + System.getProperty('tests.heap.size', '512m') +

+ 3 - 2
buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy

@@ -173,10 +173,11 @@ class ClusterFormationTasks {
 
         Task start = configureStartTask(taskName(task, node, 'start'), project, setup, node)
 
-        Task stop = configureStopTask(taskName(task, node, 'stop'), project, [], node)
-        if (node.config.daemonize && node.config.stopNodesOnCompletion) {
+        if (node.config.daemonize) {
+            Task stop = configureStopTask(taskName(task, node, 'stop'), project, [], node)
             // if we are running in the background, make sure to stop the server when the task completes
             task.finalizedBy(stop)
+            start.finalizedBy(stop)
         }
         return start
     }

+ 3 - 5
qa/rolling-upgrade/build.gradle

@@ -33,7 +33,6 @@ task oldClusterTest(type: RestIntegTestTask) {
     //numBwcNodes = 2
     numNodes = 2
     clusterName = 'rolling-upgrade'
-    stopNodesOnCompletion = false
   }
   systemProperty 'tests.rest.suite', 'old_cluster'
   systemProperty 'tests.rest.preserve_indices', 'true'
@@ -46,10 +45,10 @@ task mixedClusterTest(type: RestIntegTestTask) {
     clusterName = 'rolling-upgrade'
     unicastTransportUri = { seedNode, node, ant -> oldClusterTest.nodes.get(0).transportUri() }
     dataDir = "${-> oldClusterTest.nodes[1].dataDir}"
-    stopNodesOnCompletion = false
   }
   systemProperty 'tests.rest.suite', 'mixed_cluster'
   systemProperty 'tests.rest.preserve_indices', 'true'
+  finalizedBy 'oldClusterTest#node0.stop'
 }
 
 task upgradedClusterTest(type: RestIntegTestTask) {
@@ -61,11 +60,10 @@ task upgradedClusterTest(type: RestIntegTestTask) {
     dataDir = "${-> oldClusterTest.nodes[0].dataDir}"
   }
   systemProperty 'tests.rest.suite', 'upgraded_cluster'
+  // only need to kill the mixed cluster tests node here because we explicitly told it to not stop nodes upon completion
+  finalizedBy 'mixedClusterTest#stop'
 }
 
-// only need to kill the mixed cluster tests node here because we explicitly told it to not stop nodes upon completion
-upgradedClusterTest.finalizedBy 'mixedClusterTest#stop'
-
 task integTest {
   dependsOn = [upgradedClusterTest]
 }