Skip to content

Commit

Permalink
[JENKINS-25938] Starting to use AsynchronousExecutable.
Browse files Browse the repository at this point in the history
Originally-Committed-As: ee2ca390e73004b411e133c1832b88e977b47f28
  • Loading branch information
jglick committed Mar 20, 2015
1 parent 63d23b4 commit 89032eb
Showing 1 changed file with 11 additions and 2 deletions.
Expand Up @@ -26,6 +26,7 @@

import com.google.common.base.Function;
import hudson.model.Computer;
import hudson.model.Executor;
import hudson.model.Node;
import hudson.model.ParametersAction;
import hudson.model.ParametersDefinitionProperty;
Expand Down Expand Up @@ -107,7 +108,7 @@ public void evaluate() throws Throwable {
startBuilding();
waitForWorkflowToSuspend();
assertTrue(b.isBuilding());
assertFalse(jenkins().toComputer().isIdle());
liveness();
}
});
story.addStep(new Statement() {
Expand All @@ -118,14 +119,22 @@ public void evaluate() throws Throwable {
for (int i = 0; i < 600 && !Queue.getInstance().isEmpty(); i++) {
Thread.sleep(100);
}
assertFalse(jenkins().toComputer().isIdle());
liveness();
FileUtils.write(new File(jenkins().getRootDir(), "touch"), "I'm here");
watchDescriptor.watchUpdate();
waitForWorkflowToComplete();
assertBuildCompletedSuccessfully();
}
});
}
private void liveness() {
assertFalse(jenkins().toComputer().isIdle());
Executor e = b.getOneOffExecutor();
assertNotNull(e);
assertEquals(e, b.getExecutor());
assertTrue(e.isActive());
assertFalse(e.isAlive());
}

/**
* Workflow captures a stateful object, and we verify that it survives the restart
Expand Down

0 comments on commit 89032eb

Please sign in to comment.