diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/util/GradleUtils.java b/buildSrc/src/main/java/org/elasticsearch/gradle/util/GradleUtils.java index 84acea7932721..dc9a101f64b57 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/util/GradleUtils.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/util/GradleUtils.java @@ -152,6 +152,8 @@ public static TaskProvider addTestSourceSet(Project project, String sourceSet task.setGroup(JavaBasePlugin.VERIFICATION_GROUP); task.setTestClassesDirs(testSourceSet.getOutput().getClassesDirs()); task.setClasspath(testSourceSet.getRuntimeClasspath()); + // make the new test run after unit tests + task.mustRunAfter(project.getTasks().named("test")); }); Configuration testCompileConfig = project.getConfigurations().getByName(testSourceSet.getCompileClasspathConfigurationName());