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

failing ExecutorStepTest in jenkins versions > 2.65 #150

Merged
merged 3 commits into from
Mar 2, 2021

Conversation

car-roll
Copy link
Collaborator

When running Jenkins versions > 2.65, the ExecutorStepTest.reuseNodesWithSameLabelsInDifferentReorderedStages test will fail.

This is due to changes in LoadBalancer that were done in 2.66 here: jenkinsci/jenkins#5028

Added a note to indicate this in the test code.

Comment on lines 865 to 867
// Note: for Jenkins versions > 2.65, the number of agents must be increased to 5.
// This is due to changes in the Load Balancer (See JENKINS-60563).
for (int i = 0; i < 3; ++i) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do something like this so the test passes against all versions:

Suggested change
// Note: for Jenkins versions > 2.65, the number of agents must be increased to 5.
// This is due to changes in the Load Balancer (See JENKINS-60563).
for (int i = 0; i < 3; ++i) {
// Note: for Jenkins versions > 2.265, the number of agents must be increased to 5.
// This is due to changes in the Load Balancer (See JENKINS-60563).
int totalAgents = Jenkins.getVersion().isNewerThan(new VersionNumber("2.265")) ? 5 : 3;
for (int i = 0; i < totalAgents; ++i) {

You would also need to add an import for hudson.util.VersionNumber and I would update the Jenkinsfile to test against both the current baseline jenkins: null and the LTS candidate (jenkins: 2.277, and I would add this one to the java: 11 branch rather than adding another parallel branch).

@car-roll car-roll changed the title add warning for failing test in jenkins versions > 2.65 failing ExecutorStepTest in jenkins versions > 2.65 Mar 2, 2021
@car-roll car-roll requested a review from dwnusbaum March 2, 2021 21:30
Jenkinsfile Outdated Show resolved Hide resolved
Co-authored-by: Devin Nusbaum <dwnusbaum@users.noreply.github.com>
@car-roll car-roll merged commit 594d287 into jenkinsci:master Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants