Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-32264] Verifying that fallback behavior of ProcessLiveness f…
…or decorated launchers actually works to detect killed scripts.
  • Loading branch information
jglick committed Jan 5, 2016
1 parent 182d9f9 commit 20791b4
Showing 1 changed file with 17 additions and 0 deletions.
Expand Up @@ -96,6 +96,23 @@ public class WithContainerStepTest {
});
}

@Test public void death() {
story.addStep(new Statement() {
@Override public void evaluate() throws Throwable {
DockerTestUtil.assumeDocker();
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "p");
p.setDefinition(new CpsFlowDefinition(
"node {\n" +
" withDockerContainer('httpd:2.4.12') {\n" +
" sh 'sleep 5; kill -9 `cat .*/pid`'\n" +
" }\n" +
"}", true));
WorkflowRun b = story.j.assertBuildStatus(Result.FAILURE, p.scheduleBuild2(0).get());
story.j.assertLogContains("script returned exit code -1", b);
}
});
}

@Test public void restart() {
story.addStep(new Statement() {
@Override public void evaluate() throws Throwable {
Expand Down

0 comments on commit 20791b4

Please sign in to comment.