-
Notifications
You must be signed in to change notification settings - Fork 395
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
Stack overflow in tests; possible to disable interception for a class? #585
Comments
The only workaround I found is to convert |
It appears to be caused by having two methods with the same name in // src/com/example/HardMath.groovy
package com.example
class HardMath implements Serializable {
Object script = null
int complexOperation(int a, int b) {
script.echo "Adding ${a} to ${b}"
return a + b
}
} // vars/complexOperation.groovy
import com.example.HardMath
int call(int a, int b) {
return new HardMath(script: this).complexOperation(a, b)
} In this example, you can see the |
https://github.com/axieum/jenkinspipelineunit-issue-585 I've pushed up a reproduction (bare minimum) of this |
It appears our global steps defined in The JenkinsPipelineUnit/src/main/groovy/com/lesfurets/jenkins/unit/global/lib/LibraryLoader.groovy Lines 106 to 111 in 70482cb
The JenkinsPipelineUnit/src/main/groovy/com/lesfurets/jenkins/unit/InterceptingGCL.groovy Lines 55 to 61 in 70482cb
..which in turn replaces our class method call with a reference to the already registered global step - causing recursion: JenkinsPipelineUnit/src/main/groovy/com/lesfurets/jenkins/unit/InterceptingGCL.groovy Lines 18 to 26 in 70482cb
So, regardless of whether |
Jenkins and plugins versions report
Environment
What Operating System are you using (both controller, and any agents involved in the problem)?
The issue occurs only in tests; tests run on MacOS
Reproduction steps
I have the following directory tree:
With the following
pom.xml
:What I'm trying to accomplish:
SomeClass
can be imported bypipelineFunction.groovy
Utils
class has static methods thatSomeClass
methods can callExpected Results
I can invoke static methods
Actual Results
I'm getting a stack overflow with the following set of frames repeating:
Anything else?
I don't actually need to intercept methods in that part of code; is there something I can do to just disable interception there?
The text was updated successfully, but these errors were encountered: