@Override public void stop(@Nonnull Throwable cause) throws Exception { // should be no need to do anything special (but verify in JENKINS-26148) if (body != null) { String name = StringUtils.isEmpty(step.name) ? "jenkins" : step.name; CommitStatusUpdater.updateCommitStatus(run, null, BuildState.canceled, name, step.builds, step.connection); body.cancel(cause); } }
Collection<StepExecution> currentExecutions1 = execs[1].body.getCurrentExecutions(); // A or B, does not matter Collection<StepExecution> currentExecutions2 = execs[2].body.getCurrentExecutions(); assertThat(currentExecutions2, Matchers.<StepExecution>iterableWithSize(1)); assertEquals(semaphores, Sets.union(Sets.newLinkedHashSet(currentExecutions1), Sets.newLinkedHashSet(currentExecutions2))); assertEquals(semaphores, Sets.newLinkedHashSet(execs[0].body.getCurrentExecutions())); // the top-level one execs[0].body.cancel(); SemaphoreStep.success("c/1", null); jenkins.assertBuildStatus(Result.ABORTED, jenkins.waitForCompletion(b));
bos.flush(); Object o = getContext().newBodyInvoker().start().get();
@Override public void stop(@Nonnull Throwable cause) throws Exception { // should be no need to do anything special (but verify in JENKINS-26148) if (body != null) { PendingBuildsAction action = run.getAction(PendingBuildsAction.class); if (action != null) { for (String name : action.getBuilds()) { CommitStatusUpdater.updateCommitStatus(run, null, BuildState.canceled, name); } } body.cancel(cause); } }
@Override public void stop(Throwable cause) throws Exception { // Despite suggestion in JENKINS-26148, super.stop does not work here, even accounting for the direct call from checkAllDone. for (BodyExecution body : bodies) { body.cancel(cause); } }
@Override public void stop(Throwable cause) throws Exception { if (body != null) { body.cancel(cause); } }
/** * @deprecated * Use other overloaded forms of the cancel method to provide richer context. */ public boolean cancel(boolean b) { return cancel(new Exception()); }
/** * @deprecated * Use other overloaded forms of the cancel method to provide richer context. */ public boolean cancel(boolean b) { return cancel(new Exception()); }
@Override public void stop(@Nonnull Throwable cause) throws Exception { if (body != null) { body.cancel(cause); } }
/** * Convenience method around {@link #cancel(CauseOfInterruption...)} in case * the cause is a random exception. */ public boolean cancel(Throwable t) { return cancel(new ExceptionCause(t)); }
/** * Convenience method around {@link #cancel(CauseOfInterruption...)} in case * the cause is a random exception. */ public boolean cancel(Throwable t) { return cancel(new ExceptionCause(t)); }
body.cancel(new ExceededTimeout()); forcible = true; timeout = GRACE_PERIOD;