-
Notifications
You must be signed in to change notification settings - Fork 146
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
Fix mockito issues with JDK11 and jenkins 2.222.3 #194
Conversation
@dwnusbaum build passed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixing the Mockito issues! I added a comment about slf4j
, but instead of updating the version of slf4j
, can you please update the parent POM to 4.1
and update jenkins.version
to 2.176.4? Thanks!
pom.xml
Outdated
@@ -68,6 +68,7 @@ | |||
<revision>2.5.7</revision> | |||
<changelist>-SNAPSHOT</changelist> | |||
<jenkins.version>2.138.4</jenkins.version> | |||
<slf4jVersion>1.7.26</slf4jVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This silences the enforcer, but it isn't the ideal way to fix the issue in Jenkins. slf4j
and associated packages are dependencies of Jenkins core itself, so the version that the plugin specifies here is not actually used in practice (see this page for more information). The best way to fix this is to update the parent POM to a 4.x version, which uses a BOM to address conflicts with dependencies of Jenkins core itself, and then update jenkins.version
here to a version that supports the BOM, e.g. 2.176.4
. After that, you will be able to remove this line, and 1.7.25
will automatically be used when running against the version of Jenkins and 1.7.26
will be used when running against the new version of Jenkins, and the enforcer will be happy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was my first tentative in other PR and I removed the jenkins.version to leave the organisation pom guide the jenkins version.
Do you prefer set a specific version of jenkins instead use that one defined on organisation pom?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason why prefer 2.176.4 instead of that one defined in organisation pom (2.204) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With 2.176.4 test fails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With 2.222.3 test fails.
Override BOM plugin version with those defined in master test fails again.
Single test in eclipse not happens, debug in mvn clean test -Dmave.surefure.debug step by step not happens only run when run all together not in debug.
Seems a timing issue. The test look if a FreestyleProject master exists for top/stuff but it has not yet been by organisation folder scan.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2.176.4 is a conservative choice.
Not sure what do about test failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that nothing seems to work as expected.
The organisation pom version is the cause <= 3.56 test passes. With version >= 3.57 fails
Using jenkins.version 2.176.4 test passes (locally) but will fail on CI system because runs with 2.222.3 and will fail on enforcer.
now fails on different unit tests that always passes, re-trigger the build to verify if are flaky faillures |
@nfalco79 I think the root cause of all the remaining issues was static state from earlier tests interfering with later tests, and configuring surefire to use separate processes for each test suite ( |
This PR will fix the issue of test cases in master when run on JDK11
The solution was remove mockito from this class so that now master can use the mockito version defined in the parent pom.
@dwnusbaum the issue is regardless the version of mockito. If run individually the test pass. If you run all together something play with cache of mockito/bytebuddy that causes the constructor not be visible.