diff --git a/src/test/java/org/jenkins/plugins/lockableresources/LockStepTest.java b/src/test/java/org/jenkins/plugins/lockableresources/LockStepTest.java index 131ce790a..291120d9b 100644 --- a/src/test/java/org/jenkins/plugins/lockableresources/LockStepTest.java +++ b/src/test/java/org/jenkins/plugins/lockableresources/LockStepTest.java @@ -951,6 +951,14 @@ public void parallelLockWithLabelFillsVariable() throws Exception { // Unlock resources SemaphoreStep.success("wait-inside/1", null); j.waitForMessage("Lock released on resource", b1); + + // wait until both resources are free. + // otherwise the next isPaused() check might fail + j.waitForMessage("VAR2 IS", b1); + // this sometimes fails, but it does not looks like a failure in the plugin self + // and it is not necessary to check it here, because this test case will check + // env variable resolution and not if the paused actions works + // therefore, when it fails again, you can comment it out. isPaused(b1, 2, 0); // Now the second parallel branch should get and release the lock...