Skip to content

Commit

Permalink
[JENKINS-26399] JenkinsRuleExt.waitForCompletion/Message
Browse files Browse the repository at this point in the history
Originally-Committed-As: fac5ce62db53f18cabb2347f0bb6ae9e3f3ea1f9
  • Loading branch information
jglick committed Mar 18, 2015
1 parent e88a652 commit a6a42ae
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -26,17 +26,21 @@

import hudson.Functions;
import java.io.File;
import org.jenkinsci.plugins.workflow.BuildWatcher;
import org.jenkinsci.plugins.workflow.JenkinsRuleExt;
import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition;
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
import org.jenkinsci.plugins.workflow.job.WorkflowRun;
import org.jenkinsci.plugins.workflow.test.steps.SemaphoreStep;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.Rule;
import org.junit.runners.model.Statement;
import org.jvnet.hudson.test.RestartableJenkinsRule;

public class PushdStepTest {

@ClassRule public static BuildWatcher buildWatcher = new BuildWatcher();
@Rule public RestartableJenkinsRule story = new RestartableJenkinsRule();

private String pwdStep() {
Expand Down Expand Up @@ -66,10 +70,7 @@ private String pwdStep() {
@Override public void evaluate() throws Throwable {
SemaphoreStep.success("restarting/1", null);
WorkflowRun b = story.j.jenkins.getItemByFullName("p", WorkflowJob.class).getLastBuild();
while (b.isBuilding()) { // TODO JENKINS-26399
Thread.sleep(100);
}
story.j.assertLogContains(File.separator + "subdir", story.j.assertBuildStatusSuccess(b));
story.j.assertLogContains(File.separator + "subdir", story.j.assertBuildStatusSuccess(JenkinsRuleExt.waitForCompletion(b)));
}
});
}
Expand Down

0 comments on commit a6a42ae

Please sign in to comment.