Skip to content

Commit 594d287

Browse files
authored
failing ExecutorStepTest in jenkins versions > 2.65 (#150)
1 parent a0fd12a commit 594d287

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Jenkinsfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
buildPlugin(useAci: true, configurations: [
22
[platform: 'linux', jdk: '8'],
33
[platform: 'windows', jdk: '8'],
4-
[platform: 'linux', jdk: '11']
4+
[platform: 'linux', jdk: '11', jenkins: "2.277", javaLevel: 8]
55
])

src/test/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepTest.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
import java.util.stream.Collectors;
7474
import javax.annotation.Nullable;
7575

76+
import hudson.util.VersionNumber;
7677
import jenkins.model.Jenkins;
7778
import jenkins.security.QueueItemAuthenticator;
7879
import jenkins.security.QueueItemAuthenticatorConfiguration;
@@ -862,7 +863,10 @@ private Map<String, String> mapNodeNameToLogText(WorkflowRun workflowRun) throws
862863
@Issue("JENKINS-36547")
863864
@Test public void reuseNodesWithSameLabelsInDifferentReorderedStages() {
864865
story.then(r -> {
865-
for (int i = 0; i < 3; ++i) {
866+
// Note: for Jenkins versions > 2.65, the number of agents must be increased to 5.
867+
// This is due to changes in the Load Balancer (See JENKINS-60563).
868+
int totalAgents = Jenkins.getVersion().isNewerThan(new VersionNumber("2.265")) ? 5 : 3;
869+
for (int i = 0; i < totalAgents; ++i) {
866870
DumbSlave slave = r.createOnlineSlave();
867871
slave.setLabelString("foo bar");
868872
}

0 commit comments

Comments
 (0)