Browse Source

Fix flaky gradle integration test

Alpar Torok 7 years ago
parent
commit
a3cb74190c

+ 3 - 0
buildSrc/src/test/java/org/elasticsearch/gradle/testclusters/TestClustersPluginIT.java

@@ -55,6 +55,9 @@ public class TestClustersPluginIT extends GradleIntegrationTestCase {
     }
 
     public void testUseClusterByUpToDateTask() {
+        // Run it once, ignoring the result and again to make sure it's considered up to date.
+        // Gradle randomly considers tasks without inputs and outputs as as up-to-date or success on the first run
+        getTestClustersRunner("upToDate1", "upToDate2").build();
         BuildResult result = getTestClustersRunner("upToDate1", "upToDate2").build();
         assertTaskUpToDate(result, ":upToDate1", ":upToDate2");
         assertNotStarted(result);