Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test case for JENKINS-57253 #356

Merged
merged 1 commit into from
Dec 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@
import org.jenkinsci.plugins.workflow.steps.StepDescriptor;
import org.jenkinsci.plugins.workflow.steps.StepExecution;
import org.jenkinsci.plugins.workflow.steps.StepExecutions;
import org.jenkinsci.plugins.workflow.test.steps.SemaphoreStep;

import static org.junit.Assert.*;

import org.junit.Assert;
import org.junit.Assume;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ErrorCollector;
Expand Down Expand Up @@ -529,6 +531,24 @@ public void transformedSuperClass() throws Exception {
jenkins.assertLogContains("OUTPUT: ybase", r);
}

@Ignore("Currently fails due to leaked executor")
@Issue("JENKINS-57253")
@Test
public void unexpectedBreakStatement() throws Exception {
WorkflowJob job = jenkins.createProject(WorkflowJob.class);
job.setDefinition(new CpsFlowDefinition("node {\n" +
" semaphore 'wait'\n" +
" break\n" +
"}\n", true));
assertEquals(0, jenkins.jenkins.toComputer().countBusy());
WorkflowRun b = job.scheduleBuild2(0).waitForStart();
SemaphoreStep.waitForStart("wait/1", b);
assertEquals(1, jenkins.jenkins.toComputer().countBusy());
SemaphoreStep.success("wait/1", null);
jenkins.assertBuildStatus(Result.FAILURE, jenkins.waitForCompletion(b));
assertEquals(0, jenkins.jenkins.toComputer().countBusy());
}

@Issue("SECURITY-1186")
@Test
public void finalizer() throws Exception {
Expand Down