From 731c4daf2ae96d94971f34f5e5de6c5543caa36c Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Mon, 13 Apr 2020 13:36:54 -0600 Subject: [PATCH 1/5] Don't bundle validator dependencies Already provided by Jenkins core 2.204.1 --- pom.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7679fdf8da..1975acc2f0 100644 --- a/pom.xml +++ b/pom.xml @@ -296,7 +296,7 @@ commons-validator 1.6 - + commons-digester commons-digester @@ -304,6 +304,10 @@ commons-beanutils commons-beanutils + + commons-collections + commons-collections + From 312a83982d33ad8b11d5a88a83292f69a7e5dbea Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Mon, 13 Apr 2020 13:38:35 -0600 Subject: [PATCH 2/5] Switch from hamcrest-core to hamcrest package The hamcrest-core artifact is from the Hamcrest 1.x release. Hamcrest 2.x reworked the packaging. The contents of hamcrest-core were placed inside the new artifact 'hamcrest'. Exclude the hamcrest-core dependency from other artifacts so that they will use the contents of the hamcrest artifact. --- pom.xml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1975acc2f0..ccd7ee4055 100644 --- a/pom.xml +++ b/pom.xml @@ -146,10 +146,21 @@ org.hamcrest - hamcrest-core + hamcrest 2.2 test + + junit + junit + test + + + org.hamcrest + hamcrest-core + + + org.mockito mockito-core @@ -235,6 +246,12 @@ xmlunit-matchers 2.6.4 test + + + org.hamcrest + hamcrest-core + + org.jenkins-ci.plugins From fa8c68473bca8c97f2d7ef0888b6b4a397867b6a Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Mon, 13 Apr 2020 13:41:48 -0600 Subject: [PATCH 3/5] Use Jenkins plugin BOM 2.190.x --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ccd7ee4055..0b534bb7de 100644 --- a/pom.xml +++ b/pom.xml @@ -333,7 +333,7 @@ io.jenkins.tools.bom - bom-2.176.x + bom-2.190.x 7 import pom From 40fd01687d9747036f0a37a6658dd0e0aaa098b6 Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Mon, 13 Apr 2020 13:42:21 -0600 Subject: [PATCH 4/5] Get git client plugin version from bom Will use git client plugin 3.2.1 rather than the previous 3.0.0. --- pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0b534bb7de..0ab48a46b2 100644 --- a/pom.xml +++ b/pom.xml @@ -103,7 +103,6 @@ org.jenkins-ci.plugins git-client - 3.0.0 org.jenkins-ci.plugins From 718c4959804a541c68bcda9bd946deb38d446286 Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Mon, 13 Apr 2020 17:17:56 -0600 Subject: [PATCH 5/5] Shutdown JenkinsRule to reduce exceptions on teardown Includes a 0.5 to 0.9 second sleep after shutdown and before waiting for all detected jobs to finish. --- src/test/java/hudson/plugins/git/GitStatusTest.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/test/java/hudson/plugins/git/GitStatusTest.java b/src/test/java/hudson/plugins/git/GitStatusTest.java index 74cf4b9981..ce654af0e7 100644 --- a/src/test/java/hudson/plugins/git/GitStatusTest.java +++ b/src/test/java/hudson/plugins/git/GitStatusTest.java @@ -74,7 +74,17 @@ public void resetAllowNotifyCommitParameters() throws Exception { } @After - public void waitForAllJobsToComplete() { + public void waitForAllJobsToComplete() throws Exception { + // Put JenkinsRule into shutdown state, trying to reduce Windows cleanup exceptions + if (jenkins != null && jenkins.jenkins != null) { + jenkins.jenkins.doQuietDown(); + } + // JenkinsRule cleanup throws exceptions during tearDown. + // Reduce exceptions by a random delay from 0.5 to 0.9 seconds. + // Adding roughly 0.7 seconds to these JenkinsRule tests is a small price + // for fewer exceptions and for better Windows job cleanup. + java.util.Random random = new java.util.Random(); + Thread.sleep(500L + random.nextInt(400)); /* Windows job cleanup fails to delete build logs in some of these tests. * Wait for the jobs to complete before exiting the test so that the * build logs will not be active when the cleanup process tries to