Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[JENKINS-41276] Fixed some review comments
- Loading branch information
|
@@ -67,13 +67,11 @@ public void onFailure(StepContext context, Throwable t) { |
|
|
try { |
|
|
Run run = context.get(Run.class); |
|
|
if (run != null && t instanceof FlowInterruptedException) { |
|
|
InterruptedBuildAction action = run.getAction(InterruptedBuildAction.class); |
|
|
if (action != null) { |
|
|
for (CauseOfInterruption cause : action.getCauses()) { |
|
|
if (cause instanceof CauseOfInterruption.UserInterruption) { |
|
|
context.onFailure(t); |
|
|
return; |
|
|
} |
|
|
FlowInterruptedException fie = (FlowInterruptedException) t; |
|
|
for (CauseOfInterruption cause : fie.getCauses()) { |
|
|
if (cause instanceof CauseOfInterruption.UserInterruption) { |
|
|
context.onFailure(t); |
|
|
return; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
@@ -31,7 +31,7 @@ |
|
|
public void abortShouldNotRetry() throws Exception { |
|
|
WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p"); |
|
|
p.setDefinition(new CpsFlowDefinition( |
|
|
"int count = 0; retry(3) { echo 'trying '+(count++); semaphore 'start'; sleep 10; echo 'NotHere' }", false)); |
|
|
"int count = 0; retry(3) { echo 'trying '+(count++); semaphore 'start'; echo 'NotHere' }", true)); |
|
|
WorkflowRun b = p.scheduleBuild2(0).waitForStart(); |
|
|
SemaphoreStep.waitForStart("start/1", b); |
|
|
b.doStop(); |
|
|