Give some time to the test's job to really start
@@ -143,12 +143,14 @@ public class PipelineApiTest extends PipelineBaseTest {
job1.setDefinition(new CpsFlowDefinition("" +
"node {" +
" stage ('Build1'); " +
- " sh('sleep 60') " +
+ " sh('sleep 120') " +
" stage ('Test1'); " +
" echo ('Testing'); " +
"}"));
WorkflowRun b1 = job1.scheduleBuild2(0).waitForStart();
+ // Give the job some time to really start (allocate nodes and so on)
+ Thread.sleep(5000);
for (int i = 0; i < 10; i++) {
b1.doStop();
if (b1.getResult() != null) {
