Skip to content

Commit 27c1718

Browse files
committedFeb 27, 2020
Wait until build completes in LockStepTest#parallelLock
This commit fixes test failure with modern JTH detected by jenkinsci/jenkins-test-harness#166
1 parent 0b48954 commit 27c1718

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/test/java/org/jenkins/plugins/lockableresources/LockStepTest.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
import java.util.List;
1515
import java.util.concurrent.CyclicBarrier;
1616
import java.util.concurrent.Semaphore;
17+
18+
import hudson.model.queue.QueueTaskFuture;
1719
import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition;
1820
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
1921
import org.jenkinsci.plugins.workflow.job.WorkflowRun;
@@ -345,7 +347,8 @@ public void parallelLock() throws Exception {
345347
+ " }\n"
346348
+ "}\n"));
347349

348-
WorkflowRun b1 = p.scheduleBuild2(0).waitForStart();
350+
QueueTaskFuture<WorkflowRun> r1 = p.scheduleBuild2(0);
351+
WorkflowRun b1 = r1.waitForStart();
349352
SemaphoreStep.waitForStart("wait-b/1", b1);
350353
// both messages are in the log because branch b acquired the lock and branch a is waiting to
351354
// lock
@@ -360,6 +363,7 @@ public void parallelLock() throws Exception {
360363
isPaused(b1, 2, 0);
361364

362365
assertNotNull(LockableResourcesManager.get().fromName("resource1"));
366+
j.assertBuildStatusSuccess(r1);
363367
}
364368

365369
@Test

0 commit comments

Comments
 (0)
Please sign in to comment.