From 5812d95aa2f921dee2c7e6b9a44b31215c0452be Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Thu, 21 Apr 2022 09:36:47 -0700 Subject: [PATCH] Update plugin parent POM and BOM (#72) * Update plugin parent POM and BOM * Wait for builds to finish before cleaning up --- pom.xml | 7 +++---- .../StatusAndTimingTest.java | 16 ++++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 6abcbc9..89f5364 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 4.32 + 4.40 @@ -17,7 +17,7 @@ https://github.com/jenkinsci/${project.artifactId}-plugin - scm:git:git://github.com/${gitHubRepo}.git + scm:git:https://github.com/${gitHubRepo}.git scm:git:git@github.com:${gitHubRepo}.git https://github.com/${gitHubRepo} ${scmTag} @@ -34,7 +34,6 @@ 999999-SNAPSHOT 2.303.3 - 8 jenkinsci/${project.artifactId}-plugin @@ -56,7 +55,7 @@ io.jenkins.tools.bom bom-2.303.x - 1090.v0a_33df40457a_ + 1289.v5c4b_1c43511b_ import pom diff --git a/src/test/java/org/jenkinsci/plugins/workflow/pipelinegraphanalysis/StatusAndTimingTest.java b/src/test/java/org/jenkinsci/plugins/workflow/pipelinegraphanalysis/StatusAndTimingTest.java index 4ca375d..19e4aa8 100644 --- a/src/test/java/org/jenkinsci/plugins/workflow/pipelinegraphanalysis/StatusAndTimingTest.java +++ b/src/test/java/org/jenkinsci/plugins/workflow/pipelinegraphanalysis/StatusAndTimingTest.java @@ -371,6 +371,7 @@ public void timingTest() throws Exception { WorkflowJob job = j.jenkins.createProject(WorkflowJob.class, "parallelTimes"); job.setDefinition(new CpsFlowDefinition(jobScript, true)); WorkflowRun run = job.scheduleBuild2(0).getStartCondition().get(); + try { Thread.sleep(4000); // We need the short branch to be complete so we know timing should exceed its duration FlowExecution exec = run.getExecution(); List heads = exec.getCurrentHeads(); @@ -388,9 +389,9 @@ public void timingTest() throws Exception { // Finally, the heart of the matter: test computing durations TimingInfo times = StatusAndTiming.computeChunkTiming(run, 0, exec.getNode("2"), exec.getNode(entry.getNodeId().toString()), null); assertTrue("Underestimated duration", times.getTotalDurationMillis() >= 3000); - - j.waitForCompletion(run); - j.assertBuildStatusSuccess(run); + } finally { + j.assertBuildStatusSuccess(j.waitForCompletion(run)); + } } @Test @@ -429,6 +430,7 @@ public void testInProgressParallel() throws Exception { [11]{10}StepAtomNode Test step */ WorkflowRun run = job.scheduleBuild2(0).getStartCondition().get(); + try { SemaphoreStep.waitForStart("wait/1", run); FlowExecution exec = run.getExecution(); @@ -472,6 +474,9 @@ public void testInProgressParallel() throws Exception { assertEquals((double) incompleteBranchTime, (double) info.getTotalDurationMillis(), 2.0); SemaphoreStep.success("wait/1", null); + } finally { + j.assertBuildStatusSuccess(j.waitForCompletion(run)); + } } @Test @@ -671,6 +676,7 @@ public void queuedAndParallel() throws Exception { "}\n", true)); WorkflowRun b1 = job.scheduleBuild2(0).waitForStart(); + try { SemaphoreStep.waitForStart("wait-b/1", b1); j.waitForMessage("Still waiting to schedule task", b1); @@ -725,7 +731,9 @@ public void queuedAndParallel() throws Exception { assertEquals(GenericStatus.IN_PROGRESS, StatusAndTiming.condenseStatus(statuses.values())); SemaphoreStep.success("wait-a/1", null); - j.assertBuildStatusSuccess(j.waitForCompletion(b1)); + } finally { + j.assertBuildStatusSuccess(j.waitForCompletion(b1)); + } } @Test