From cbb0b73d8f29ec8508590344ff77cd4a81e56898 Mon Sep 17 00:00:00 2001 From: Marat Radchenko Date: Tue, 17 Dec 2019 12:15:33 +0300 Subject: [PATCH 1/3] Bump parent pom to 3.54 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2cad3b37d..407f61143 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 3.47 + 3.54 From 97dc9f3c750f839339a8ddfc387a6007c13ac6d4 Mon Sep 17 00:00:00 2001 From: Marat Radchenko Date: Tue, 17 Dec 2019 13:07:38 +0300 Subject: [PATCH 2/3] Wait until build completes in LockStepTest#parallelLock This commit fixes test failure with modern JTH detected by jenkinsci/jenkins-test-harness#166 --- .../org/jenkins/plugins/lockableresources/LockStepTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/jenkins/plugins/lockableresources/LockStepTest.java b/src/test/java/org/jenkins/plugins/lockableresources/LockStepTest.java index c00cda224..1691977ac 100644 --- a/src/test/java/org/jenkins/plugins/lockableresources/LockStepTest.java +++ b/src/test/java/org/jenkins/plugins/lockableresources/LockStepTest.java @@ -14,6 +14,8 @@ import java.util.List; import java.util.concurrent.CyclicBarrier; import java.util.concurrent.Semaphore; + +import hudson.model.queue.QueueTaskFuture; import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition; import org.jenkinsci.plugins.workflow.job.WorkflowJob; import org.jenkinsci.plugins.workflow.job.WorkflowRun; @@ -345,7 +347,8 @@ public void parallelLock() throws Exception { + " }\n" + "}\n")); - WorkflowRun b1 = p.scheduleBuild2(0).waitForStart(); + QueueTaskFuture r1 = p.scheduleBuild2(0); + WorkflowRun b1 = r1.waitForStart(); SemaphoreStep.waitForStart("wait-b/1", b1); // both messages are in the log because branch b acquired the lock and branch a is waiting to // lock @@ -360,6 +363,7 @@ public void parallelLock() throws Exception { isPaused(b1, 2, 0); assertNotNull(LockableResourcesManager.get().fromName("resource1")); + j.assertBuildStatusSuccess(r1); } @Test From 21a475e0ca8704ca999a015907941fd8d6e0f63c Mon Sep 17 00:00:00 2001 From: Marat Radchenko Date: Wed, 18 Dec 2019 20:37:21 +0300 Subject: [PATCH 3/3] Bump workflow-job to 2.31 This commit fixes file descriptor leak in `LockStepHardKillTest` that is detected by newer JTH. All other dependency updates are chain reaction caused by dependency enforcer. --- pom.xml | 34 ++++++++++++++++--- .../lockableresources/LockStepTest.java | 6 ++-- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 407f61143..32a98f98c 100644 --- a/pom.xml +++ b/pom.xml @@ -53,8 +53,8 @@ 2.8 -SNAPSHOT 8 - 2.12 - 2.60.3 + 2.21 + 2.138.4 1.25 @@ -77,7 +77,7 @@ org.jenkins-ci.plugins script-security - 1.33 + 1.39 com.infradna.tool @@ -115,7 +115,7 @@ org.jenkins-ci.plugins.workflow workflow-job - 2.0 + 2.31 test @@ -131,8 +131,34 @@ tests test + + org.jenkins-ci.plugins + junit + 1.15 + test + + + + + org.jenkins-ci.plugins.workflow + workflow-step-api + 2.16 + + + org.jenkins-ci.plugins.workflow + workflow-api + 2.32 + + + org.jenkins-ci.plugins + structs + 1.17 + + + + repo.jenkins-ci.org diff --git a/src/test/java/org/jenkins/plugins/lockableresources/LockStepTest.java b/src/test/java/org/jenkins/plugins/lockableresources/LockStepTest.java index 1691977ac..2e950bb09 100644 --- a/src/test/java/org/jenkins/plugins/lockableresources/LockStepTest.java +++ b/src/test/java/org/jenkins/plugins/lockableresources/LockStepTest.java @@ -352,14 +352,14 @@ public void parallelLock() throws Exception { SemaphoreStep.waitForStart("wait-b/1", b1); // both messages are in the log because branch b acquired the lock and branch a is waiting to // lock - j.waitForMessage("[b] Lock acquired on [resource1]", b1); + j.waitForMessage("Lock acquired on [resource1]", b1); j.waitForMessage( - "[a] [resource1] is locked by " + b1.getFullDisplayName() + ", waiting...", b1); + "[resource1] is locked by " + b1.getFullDisplayName() + ", waiting...", b1); isPaused(b1, 2, 1); SemaphoreStep.success("wait-b/1", null); - j.waitForMessage("[a] Lock acquired on [resource1]", b1); + j.waitForMessage("Lock acquired on [resource1]", b1); isPaused(b1, 2, 0); assertNotNull(LockableResourcesManager.get().fromName("resource1"));