diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy index 54a14138505..893f767e26e 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy @@ -904,6 +904,7 @@ class BuildPlugin implements Plugin { project.tasks.withType(RandomizedTestingTask) {task -> jvm "${project.runtimeJavaHome}/bin/java" parallelism System.getProperty('tests.jvms', project.rootProject.ext.defaultParallel) + ifNoTests 'fail' onNonEmptyWorkDirectory 'wipe' leaveTemporary true project.sourceSets.matching { it.name == "test" }.all { test ->