Skip to content

Commit

Permalink
[JENKINS-20662] Simplify test after feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-beck committed Apr 23, 2014
1 parent 26735ec commit b59c490
Showing 1 changed file with 2 additions and 9 deletions.
Expand Up @@ -6,6 +6,7 @@ import hudson.model.listeners.RunListener
import org.junit.Rule
import org.junit.Test
import org.jvnet.hudson.test.Bug
import org.jvnet.hudson.test.SleepBuilder
import org.jvnet.hudson.test.JenkinsRule

class LazyBuildMixIn_Test {
Expand All @@ -15,16 +16,8 @@ class LazyBuildMixIn_Test {
@Test
@Bug(20662)
public void testNewRunningBuildRelationFromPrevious() {
RunListener<Run> listener = new RunListener<Run>() {
@Override public void onCompleted(Run r, TaskListener listener) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
}
};
RunListener.all().add(listener);
def p = r.createFreeStyleProject();
p.buildersList.replaceBy([new SleepBuilder(1000)])
def b1 = p.scheduleBuild2(0).get();
assert null == b1.getNextBuild();
def b2 = p.scheduleBuild2(0).waitForStart();
Expand Down

0 comments on commit b59c490

Please sign in to comment.