-
Notifications
You must be signed in to change notification settings - Fork 396
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
v1.4 lib class preload causes MissingMethodException with lib var step accepting lib class argument #224
Comments
brianeray
added a commit
to brianeray/JenkinsPipelineUnit
that referenced
this issue
Jul 1, 2020
FILL IN THE BLANKS. This is a preliminary commit just to ship WIP from the abandoned `support-lazy-lib-class-load` branch.
brianeray
added a commit
to brianeray/JenkinsPipelineUnit
that referenced
this issue
Jul 1, 2020
Preload lib classes prior to lib vars so that vars can use lib classes as method argument types without spurious type mismatches and `MissingMethodException`s. This was an odd side effect of the class preload logic in 1.4's 5c90975 and 6f2639f, which caused the classes to be loaded twice, confusing the method interceptor's matching logic.
brianeray
added a commit
to brianeray/JenkinsPipelineUnit
that referenced
this issue
Jul 8, 2020
Troubleshooting debugging and related only, because the fix is not working. But maybe this can be useful down the road.
brianeray
added a commit
to brianeray/JenkinsPipelineUnit
that referenced
this issue
Jul 9, 2020
TEMP COMMIT: Rebase all WIP on `master`.
brianeray
added a commit
to brianeray/JenkinsPipelineUnit
that referenced
this issue
Jul 9, 2020
brianeray
added a commit
to brianeray/JenkinsPipelineUnit
that referenced
this issue
Jul 9, 2020
brianeray
added a commit
to brianeray/JenkinsPipelineUnit
that referenced
this issue
Jul 9, 2020
v1.4 introduced the preload of shared library classes alongside the existing preload of vars (ie custom steps). In most use cases this is ideal. However in some use cases library steps that use library classes in their call arguments are subject to mistaken `MissingMethodException` errors when those classes are preloaded. The method interceptor becomes confused because at some point the same types are loaded more that once, and the argument passed to the interceptor appears to be of a different type than the type registered in the interceptor. In those use cases the pre-v1.4 behavior of lazy loading the library classes is helpful. The new `LibraryLoader.preloadLibraryClasses` property can be set by the test to disable the class preload.
PR #244 |
brianeray
added a commit
to brianeray/JenkinsPipelineUnit
that referenced
this issue
Jul 10, 2020
stchar
added a commit
that referenced
this issue
Jul 13, 2020
Issue #224 support lazy library class loading
Found very strange behavior: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is probably best explained by first looking at PR #223. Note the test resources at the bottom of the PR. The
Monster1
lib class andmonster1
lib custom step are a common pattern in our pipeline code base.Prior to 1.4 the JPU framework had no problem matching the lib step's
call
method signature with a caller passing an instance of the lib class to it. With all the logging from the PR in place and the class preload logic commented out the call to the step will be successful, and my diagnostic logging looks something like this.If the lib class preload logic is restored then the diagnostic logging reveals a fatal arg type mismatch.
This is the hardest JPU problem I've encountered. I tried replacing the method registration in
PipelineTestHelper.setGlobalVars(Binding)
as follows.But if my memory is correct the arg types at runtime were still incompatible.
The text was updated successfully, but these errors were encountered: