From 20b0a131446fc0d3edd08ba0889a55334020b169 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 30 Mar 2016 10:56:19 -0400 Subject: [PATCH] Merge pull request #2188 from jglick/flakiness Use rerunFailingTestsCount rather than @RandomlyFails (cherry picked from commit c54c363bfeeb1769ed9b9843dbd9fbff68413159) --- pom.xml | 2 +- test/pom.xml | 3 +-- test/src/test/groovy/hudson/cli/BuildCommandTest.groovy | 5 ++--- test/src/test/java/hudson/model/UpdateCenter2Test.java | 5 +---- test/src/test/java/hudson/model/UpdateCenterTest.java | 7 ++----- .../src/test/java/hudson/slaves/NodeProvisionerTest.java | 9 ++++----- test/src/test/java/hudson/tasks/FingerprinterTest.java | 3 +-- 7 files changed, 12 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index 6eca811d01..cd1d6a4e5a 100644 --- a/pom.xml +++ b/pom.xml @@ -365,7 +365,7 @@ THE SOFTWARE. org.apache.maven.plugins maven-surefire-plugin - 2.16 + 2.19.1 -noverify diff --git a/test/pom.xml b/test/pom.xml index 9b4f79095c..b553a948f9 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -39,7 +39,6 @@ THE SOFTWARE. 2 false - false @@ -236,7 +235,6 @@ THE SOFTWARE. true ${mavenDebug} ${project.build.directory} - ${ignore.random.failures} true ${concurrency} @@ -307,6 +305,7 @@ THE SOFTWARE. true + 4 diff --git a/test/src/test/groovy/hudson/cli/BuildCommandTest.groovy b/test/src/test/groovy/hudson/cli/BuildCommandTest.groovy index bec4c67584..488d0327bd 100644 --- a/test/src/test/groovy/hudson/cli/BuildCommandTest.groovy +++ b/test/src/test/groovy/hudson/cli/BuildCommandTest.groovy @@ -35,7 +35,6 @@ import org.junit.Test import org.jvnet.hudson.test.Issue import org.jvnet.hudson.test.CaptureEnvironmentBuilder import org.jvnet.hudson.test.JenkinsRule -import org.jvnet.hudson.test.RandomlyFails import org.jvnet.hudson.test.TestBuilder import org.jvnet.hudson.test.TestExtension import org.kohsuke.stapler.StaplerRequest @@ -159,7 +158,7 @@ public class BuildCommandTest { } } - @RandomlyFails("Started test0 #1") + // TODO randomly fails: Started test0 #1 @Test void consoleOutput() { def p = j.createFreeStyleProject() def cli = new CLI(j.URL) @@ -174,7 +173,7 @@ public class BuildCommandTest { } } - @RandomlyFails("Started test0 #1") + // TODO randomly fails: Started test0 #1 @Test void consoleOutputWhenBuildSchedulingRefused() { def p = j.createFreeStyleProject() def cli = new CLI(j.URL) diff --git a/test/src/test/java/hudson/model/UpdateCenter2Test.java b/test/src/test/java/hudson/model/UpdateCenter2Test.java index d143882405..ca0f3b2378 100644 --- a/test/src/test/java/hudson/model/UpdateCenter2Test.java +++ b/test/src/test/java/hudson/model/UpdateCenter2Test.java @@ -31,9 +31,6 @@ import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.Issue; import org.jvnet.hudson.test.JenkinsRule; -import org.jvnet.hudson.test.RandomlyFails; - -import java.io.IOException; /** * @@ -47,7 +44,7 @@ public class UpdateCenter2Test { /** * Makes sure a plugin installs fine. */ - @RandomlyFails("SocketTimeoutException from goTo due to GET http://localhost:…/update-center.json?…") + // TODO randomly fails: SocketTimeoutException from goTo due to GET http://localhost:…/update-center.json?… @Test public void install() throws Exception { UpdateSite.neverUpdate = false; j.jenkins.pluginManager.doCheckUpdatesServer(); // load the metadata diff --git a/test/src/test/java/hudson/model/UpdateCenterTest.java b/test/src/test/java/hudson/model/UpdateCenterTest.java index 0fc68a1a04..c073e4206b 100644 --- a/test/src/test/java/hudson/model/UpdateCenterTest.java +++ b/test/src/test/java/hudson/model/UpdateCenterTest.java @@ -47,11 +47,8 @@ public class UpdateCenterTest { doData("http://updates.jenkins-ci.org/update-center.json?version=build"); doData("http://updates.jenkins-ci.org/stable/update-center.json?version=build"); } catch (Exception x) { - if (Boolean.getBoolean("ignore.random.failures")) { - assumeNoException("Might be no Internet connectivity, or might start failing due to expiring certificate through no fault of code changes", x); - } else { - throw x; - } + // TODO this should not be in core at all; should be in repo built by a separate job somewhere + assumeNoException("Might be no Internet connectivity, or might start failing due to expiring certificate through no fault of code changes", x); } } private void doData(String location) throws Exception { diff --git a/test/src/test/java/hudson/slaves/NodeProvisionerTest.java b/test/src/test/java/hudson/slaves/NodeProvisionerTest.java index 70ffebb0af..7374eb8b77 100644 --- a/test/src/test/java/hudson/slaves/NodeProvisionerTest.java +++ b/test/src/test/java/hudson/slaves/NodeProvisionerTest.java @@ -39,7 +39,6 @@ import static org.junit.Assert.*; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.JenkinsRule; -import org.jvnet.hudson.test.RandomlyFails; import org.jvnet.hudson.test.SleepBuilder; /** @@ -85,7 +84,7 @@ public class NodeProvisionerTest { /** * Scenario: schedule a build and see if one slave is provisioned. */ - @RandomlyFails("fragile") + // TODO fragile @Test public void autoProvision() throws Exception { BulkChange bc = new BulkChange(r.jenkins); try { @@ -107,7 +106,7 @@ public class NodeProvisionerTest { /** * Scenario: we got a lot of jobs all of the sudden, and we need to fire up a few nodes. */ - @RandomlyFails("fragile") + // TODO fragile @Test public void loadSpike() throws Exception { BulkChange bc = new BulkChange(r.jenkins); try { @@ -126,7 +125,7 @@ public class NodeProvisionerTest { /** * Scenario: make sure we take advantage of statically configured slaves. */ - @RandomlyFails("fragile") + // TODO fragile @Test public void baselineSlaveUsage() throws Exception { BulkChange bc = new BulkChange(r.jenkins); try { @@ -147,7 +146,7 @@ public class NodeProvisionerTest { /** * Scenario: loads on one label shouldn't translate to load on another label. */ - @RandomlyFails("fragile") + // TODO fragile @Test public void labels() throws Exception { BulkChange bc = new BulkChange(r.jenkins); try { diff --git a/test/src/test/java/hudson/tasks/FingerprinterTest.java b/test/src/test/java/hudson/tasks/FingerprinterTest.java index c1ac17d21c..d231a3bbd9 100644 --- a/test/src/test/java/hudson/tasks/FingerprinterTest.java +++ b/test/src/test/java/hudson/tasks/FingerprinterTest.java @@ -54,7 +54,6 @@ import org.junit.Test; import org.jvnet.hudson.test.Issue; import org.jvnet.hudson.test.JenkinsRule; -import org.jvnet.hudson.test.RandomlyFails; import org.jvnet.hudson.test.recipes.LocalData; /** @@ -315,7 +314,7 @@ public class FingerprinterTest { } @SuppressWarnings("unchecked") - @RandomlyFails("for p3.upstreamProjects expected:<[hudson.model.FreeStyleProject@590e5b8[test0]]> but was:<[]>") + // TODO randomly fails: for p3.upstreamProjects expected:<[hudson.model.FreeStyleProject@590e5b8[test0]]> but was:<[]> @Issue("JENKINS-18417") @Test public void fingerprintCleanup() throws Exception { -- GitLab