diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy index 20dd19d556e..47b76ce2c54 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy @@ -139,7 +139,7 @@ class ClusterFormationTasks { // elasticsearch.bat is spawned as it has no daemon mode start = project.tasks.create(name: "${task.name}#start", type: DefaultTask, dependsOn: setup) << { // Fall back to Ant exec task as Gradle Exec task does not support spawning yet - ant.exec(executable: 'cmd', spawn: true, dir: home) { + ant.exec(executable: 'cmd', spawn: true, dir: home, failonerror: true) { esEnv.each { key, value -> env(key: key, value: value) } (['/C', 'call', 'bin/elasticsearch'] + esArgs).each { arg(value: it) } }