Running tests using jenkins-test-harness and running to java.lang.NoSuchMethodError: org.jvnet.tiger_types.Types.bind

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Running tests using jenkins-test-harness and running to java.lang.NoSuchMethodError: org.jvnet.tiger_types.Types.bind

Michael Kobit
I'm attempting to test some global pipeline libraries (https://jenkins.io/doc/book/pipeline/shared-libraries/) locally in a test Jenkins instance.

Previously, I had set up the Job DSL to create jobs and run each global library test in its own job. This is confusing and difficult to main for us, so I wanted to move these tests to be able to execute locally using the @JenkinsRule.

I'm running into some complications which eventually seems to lead to different test results. It might be my setup, so was hoping I could get some advice or something around what I'm doing wrong or how to better dive into it. I'm guessing the slaves/plugins are started with a non-deterministic classpath (or possibly plugin loading causes problems) but I see errors like java.lang.NoSuchMethodError: org.jvnet.tiger_types.Types.bind(Ljava/lang/reflect/Type;Ljava/lang/reflect/GenericDeclaration;Ljava/lang/reflect/ParameterizedType;)Ljava/lang/reflect/Type;. Anybody have any ideas?

Some of build.gradle
---
plugins {
id 'groovy'
id 'codenarc'
}

final String testsDir = 'test'
ext['unitTestsDir'] = "${testsDir}/unit"
ext['integrationTestsDir'] = "${testsDir}/integration"
ext['groovyVersion'] = "2.4.11"

sourceSets {
main {
groovy {
// Jenkins Global Workflow Libraries requires sources to be at 'src'
srcDirs = ['src']
}
}
test {
groovy {
// configure the test source set so that it is not part of the Global Pipeline Libraries
srcDirs = ["${unitTestsDir}/src"]
}
}
integrationTests {
groovy {
srcDirs = ["${integrationTestsDir}/src"]
}
resources {
srcDirs = ["${integrationTestsDir}/resources"]
}
}
functionalTests {
groovy {
srcDirs = [functionalTestsDir]
}
compileClasspath += sourceSets.main.compileClasspath + sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
all {
java {
srcDirs = []
}
}
[main, test, functionalTests].each {
configure(it) {
resources {
srcDirs = []
}
}
}
}

ext.jenkinsCoreVersion = "2.63"

ext.jenkinsTestDependencies = [
"org.jenkins-ci.main:jenkins-test-harness:2.24",
"org.jenkins-ci.main:jenkins-war:${ext.jenkinsCoreVersion}",
"org.jenkins-ci.main:jenkins-war:${ext.jenkinsCoreVersion}:war-for-test@jar"
]

ext.pluginArtifacts = [
"org.jenkins-ci.plugins:mercurial:1.61",
"org.jenkins-ci.plugins:pam-auth:1.3",
"org.jenkins-ci.plugins:script-security:1.29.1",
"org.jenkins-ci.plugins:timestamper:1.8.8",
"org.jenkins-ci.plugins:matrix-project:1.11",
"org.jenkins-ci.plugins:windows-slaves:1.3.1",
"org.jenkins-ci.plugins:github-api:1.86",
"org.jenkins-ci.plugins:mailer:1.20",
"org.jenkins-ci.plugins:ldap:1.16",
"org.jenkins-ci.plugins.icon-shim:icon-shim:2.0.3",
"org.jenkins-ci.plugins:matrix-auth:1.7",
"org.jenkins-ci.plugins:subversion:2.9",
"org.jenkins-ci.plugins:antisamy-markup-formatter:1.5",
"org.jenkins-ci.plugins:pipeline-build-step:2.5.1",
"org.jenkins-ci.plugins:external-monitor-job:1.7",
"org.jenkins-ci.plugins:ant:1.5",
"org.jenkins-ci.plugins:token-macro:2.1",
"org.jenkins-ci.plugins:build-timeout:1.18",
"org.jenkins-ci.plugins:cloudbees-folder:6.0.4",
"org.jenkins-ci.plugins:credentials:2.1.14",
"org.jenkins-ci.plugins:structs:1.9",
"org.jenkins-ci.plugins:pipeline-input-step:2.7",
"org.jenkins-ci.plugins:scm-api:2.1.1",
"org.jenkins-ci.plugins:plain-credentials:1.4",
"org.jenkins-ci.plugins:pipeline-stage-step:2.2",
"org.jenkins-ci.plugins:credentials-binding:1.12",
"org.jenkins-ci.plugins.pipeline-stage-view:pipeline-rest-api:2.8",
"org.jenkins-ci.plugins:email-ext:2.58",
"org.jenkins-ci.plugins:ssh-credentials:1.13",
"io.jenkins.blueocean:blueocean-commons:1.1.4",
"org.jenkins-ci.plugins:git-client:2.4.6",
"org.jenkins-ci.plugins:ssh-agent:1.15",
"org.jenkins-ci.plugins:mapdb-api:1.0.9.0",
"org.jenkins-ci.plugins:git:3.3.2",
"org.jenkins-ci.plugins:junit:1.20",
"org.jenkins-ci.plugins.workflow:workflow-basic-steps:2.6",
"org.jenkins-ci.ui:jquery-detached:1.2.1",
"org.jenkins-ci.plugins:ws-cleanup:0.33",
"org.jenkins-ci.plugins.workflow:workflow-api:2.18",
"io.jenkins.blueocean:blueocean-github-pipeline:1.1.4",
"org.jenkins-ci.plugins:pubsub-light:1.10",
"com.coravy.hudson.plugins.github:github:1.27.0",
"org.jenkins-ci.plugins.workflow:workflow-job:2.13",
"org.jenkins-ci.plugins.workflow:workflow-aggregator:2.5",
"org.jenkins-ci.ui:handlebars:1.1.1",
"org.jenkins-ci.plugins.workflow:workflow-support:2.14",
"org.jenkins-ci.ui:momentjs:1.1.1",
"org.jenkins-ci.plugins.pipeline-stage-view:pipeline-stage-view:2.8",
"org.jenkins-ci.plugins:ssh-slaves:1.20",
"org.jenkins-ci.plugins:durable-task:1.14",
"org.jenkins-ci.plugins.workflow:workflow-step-api:2.12",
"org.jenkins-ci.ui:ace-editor:1.1",
"org.jenkins-ci.plugins:javadoc:1.4",
"org.jenkins-ci.plugins.workflow:workflow-scm-step:2.6",
"io.jenkins.blueocean:blueocean-rest:1.1.4",
"org.jenkins-ci.plugins.workflow:workflow-cps:2.36.1",
"org.jenkins-ci.plugins:docker-commons:1.8",
"org.jenkins-ci.plugins:git-server:1.7",
"org.jenkins-ci.plugins.workflow:workflow-multibranch:2.16",
"org.jenkins-ci.plugins.workflow:workflow-cps-global-lib:2.8",
"org.jenkins-ci.plugins:branch-api:2.0.10",
"org.jenkins-ci.plugins:bouncycastle-api:2.16.1",
"org.jenkinsci.plugins:managed-scripts:1.3",
"org.jenkins-ci.plugins.workflow:workflow-durable-task-step:2.12",
"org.jenkins-ci.plugins:github-organization-folder:1.6",
"org.jenkins-ci.plugins:github-branch-source:2.0.8",
"org.jenkins-ci.plugins:authentication-tokens:1.3",
"org.jenkins-ci.plugins:docker-workflow:1.12",
"com.cloudbees.jenkins.plugins:docker-custom-build-environment:1.6.5",
"org.jenkins-ci.plugins:promoted-builds:2.29",
"org.jenkins-ci.plugins:htmlpublisher:1.14",
"org.jenkins-ci.plugins:docker-build-step:1.43",
"org.jenkins-ci.plugins:pipeline-utility-steps:1.3.0",
"io.jenkins.blueocean:blueocean:1.1.4",
"org.jenkins-ci.plugins:conditional-buildstep:1.3.6",
"org.jenkins-ci.plugins:greenballs:1.15",
"org.jenkins-ci.plugins:parameterized-trigger:2.35",
"com.synopsys.arc.jenkinsci.plugins:job-restrictions:0.6",
"org.jenkins-ci.plugins:cloudbees-bitbucket-branch-source:2.1.2",
"com.sonyericsson.hudson.plugins.rebuild:rebuild:1.25",
"org.jenkins-ci.main:maven-plugin:2.17",
"org.jenkins-ci.plugins:multiple-scms:0.6",
"org.jenkins-ci.plugins:copyartifact:1.38.1",
"org.jenkins-ci.plugins:gatling:1.2.2",
"org.jenkins-ci.plugins:jquery:1.11.2-0",
"org.jenkins-ci.plugins:extended-choice-parameter:0.76",
"org.jenkins-ci.plugins:run-condition:1.0",
"org.jenkins-ci.plugins:flexible-publish:0.15.2",
"io.jenkins.blueocean:blueocean-rest-impl:1.1.4",
"io.jenkins.blueocean:blueocean-dashboard:1.1.4",
"org.jenkins-ci.plugins:build-blocker-plugin:1.7.3",
"org.jenkins-ci.plugins:config-file-provider:2.16.0",
"org.jenkins-ci.plugins:build-name-setter:1.6.5",
"org.jenkins-ci.plugins:ansicolor:0.5.0",
"io.jenkins.blueocean:blueocean-web:1.1.4",
"org.jenkinsci.plugins:pipeline-stage-tags-metadata:1.1.8",
"io.jenkins.blueocean:blueocean-jwt:1.1.4",
"org.jenkins-ci.plugins:blueocean-autofavorite:1.0.0",
"org.jvnet.hudson.plugins:favorite:2.3.0",
"org.jenkins-ci.plugins:throttle-concurrents:2.0.1",
"io.jenkins.blueocean:blueocean-git-pipeline:1.1.4",
"org.jenkins-ci.plugins:resource-disposer:0.6",
"org.jenkins-ci.plugins:sse-gateway:1.15",
"org.jenkinsci.plugins:pipeline-model-api:1.1.8",
"io.jenkins.blueocean:blueocean-pipeline-api-impl:1.1.4",
"org.jenkins-ci.plugins:pipeline-milestone-step:1.3.1",
"io.jenkins.blueocean:blueocean-events:1.1.4",
"org.jenkins-ci.plugins:stash-pullrequest-builder:1.7.0",
"org.jenkinsci.plugins:pipeline-model-definition:1.1.8",
"org.jenkins-ci.plugins:pipeline-github-lib:1.0",
"org.jenkins-ci.plugins:blueocean-display-url:2.0",
"org.jenkins-ci.plugins:variant:1.1",
"io.jenkins.blueocean:blueocean-personalization:1.1.4",
"org.6wind.jenkins:lockable-resources:2.0",
"org.jenkins-ci.plugins:pipeline-graph-analysis:1.4",
"io.jenkins.blueocean:blueocean-config:1.1.4",
"org.jenkins-ci.plugins:job-dsl:1.64",
"org.jenkins-ci.ui:bootstrap:1.3.2",
"org.jenkinsci.plugins:pipeline-model-declarative-agent:1.1.1",
"io.jenkins.blueocean:blueocean-i18n:1.1.4",
"org.jenkins-ci.plugins:jackson2-api:2.7.3",
"org.jenkins-ci.plugins:display-url-api:2.0",
"io.jenkins.blueocean:blueocean-pipeline-editor:0.2.0",
"org.jenkins-ci.plugins:docker-traceability:1.2",
"io.jenkins.blueocean:blueocean-pipeline-scm-api:1.1.4",
"org.jenkinsci.plugins:pipeline-model-extensions:1.1.8"
]

dependencies {
ivy group: 'org.apache.ivy', name: 'ivy', version: '2.4.0'
implementation group: 'org.codehaus.groovy', name: 'groovy-all', version: groovyVersion

testImplementation group: 'org.spockframework', name: 'spock-core', version: '1.1-groovy-2.4'
// We use a lower version of Guava to deal with Jenkins transitive dependency issues.
// In https://github.com/google/guava/wiki/Release21 the MoreExecutors.sameThreadExecutor() was removed.
// Jenkins relies on this method, so if use a Guava version that doesn't have it we get a java.lang.NoSuchMethodError
// It is removed in 21 (https://github.com/google/guava/wiki/Release21), so we have to stay below it
// See https://issues.jenkins-ci.org/browse/JENKINS-36779 for Jenkins issue regarding relocating the dependencies.
testImplementation group: 'com.google.guava', name: 'guava', version: '20.0'
testImplementation group: 'junit', name: 'junit', version: '4.12'

final String slf4jVersion = '1.7.25'
integrationTestsImplementation group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion
integrationTestsImplementation group: 'org.slf4j', name: 'slf4j-simple', version: slf4jVersion
// Dependency to get source code completion for the resource files
integrationTestsCompileOnly(sourceSets.main.output)
for (final jenkinsTest in project.ext.jenkinsTestDependencies) {
integrationTestsImplementation(jenkinsTest)
}

for (final plugin in project.ext.pluginArtifacts) {
integrationTestsImplementation(plugin) { dependency ->
force = true
artifact {
name = dependency.name
type = 'jar'
}
artifact {
name = dependency.name
type = 'hpi'
}
}
}
}

final integrationTest = tasks.create('integrationTest', Test) {
dependsOn('classes')
mustRunAfter('test')
group = LifecycleBasePlugin.VERIFICATION_GROUP
final SourceSet integrationTestsSourceSet = sourceSets.getByName('integrationTests')
testClassesDirs = integrationTestsSourceSet.output.classesDirs
classpath = sourceSets.integrationTests.runtimeClasspath
forkEvery = 1
// Filter the environment variables down so that they are not inherited from the Gradle process.
// In Jenkins, it inherits all Git (and whatever else variables)
environment = System.getenv().findAll { key, value ->
// Allow keys to pass through if they are prefixed correctly or need to be passed through.
// We will use these to do passthrough of credentials in some tests, and some Jenkins configurations also need to be passed through.
// The SSH environment info, for instance, needs to be setup correctly based on how the 'sshagent' step configures the environment in a Jenkinsfile.
key.startsWith('INTEGRATION_TEST') || key.startsWith('SSH_')
}

// set build directory for Jenkins test harness, JENKINS-26331
systemProperty('buildDirectory', project.buildDir.absolutePath)
// Default is 3 minutes per test so we lower it to something easier to iterate with.
systemProperty('jenkins.test.timeout', 60L)
// Force any temporary files to be created inside the build directory.
systemProperty('java.io.tmpdir', project.file("$buildDir/integrationTestTmp"))
testLogging {
lifecycle.events('started', 'skipped')
}
}

---

Base Spock Specification
package pipelineUtilities.testing

import com.cloudbees.plugins.credentials.CredentialsScope
import com.cloudbees.plugins.credentials.CredentialsStore
import com.cloudbees.plugins.credentials.SystemCredentialsProvider
import com.cloudbees.plugins.credentials.domains.Domain
import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl
import groovy.util.logging.Slf4j
import jenkins.plugins.git.GitSCMSource
import org.jenkinsci.plugins.workflow.libs.GlobalLibraries
import org.jenkinsci.plugins.workflow.libs.LibraryConfiguration
import org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever
import org.junit.Rule
import org.jvnet.hudson.test.JenkinsRule
import spock.lang.Specification

@Slf4j
abstract class PipelineIntegrationBaseSpec extends Specification {

@Rule
JenkinsRule rule = new JenkinsRule()

void setup() {
configureSlaves()
configureGlobalLibraries()
configureCredentials()
}

private void configureCredentials() {
if (Conditions.ARTIFACTORY_CREDENTIALS()) {
log.debug('Artifactory credentials present, creating and adding them to @JenkinsRule')
final Domain domain = Domain.global()
final CredentialsStore store =
rule.jenkins.getExtensionList(SystemCredentialsProvider.ProviderImpl)
.first()
.getStore(rule.jenkins)

final UsernamePasswordCredentialsImpl artifactoryLogin = new UsernamePasswordCredentialsImpl(
CredentialsScope.GLOBAL,
'Artifactory-UsernamePassword-ArtifactoryReadWrite',
'',
System.getenv('INTEGRATION_TEST_ARTIFACTORY_USERNAME'),
System.getenv('INTEGRATION_TEST_ARTIFACTORY_PASSWORD')
)

store.addCredentials(domain, artifactoryLogin)
}
}

private void configureGlobalLibraries() {
final SCMSourceRetriever retriever = new SCMSourceRetriever(
new GitSCMSource(
null,
System.getProperty('user.dir'),
'',
'local-source-code',
// Fetch everything - if this is not used builds fail on Jenkins for some reason
'*:refs/remotes/origin/*',
'*',
'',
true
)
)
final LibraryConfiguration localLibrary =
new LibraryConfiguration('pipelineUtilities', retriever)
localLibrary.implicit = true
localLibrary.defaultVersion = 'git rev-parse HEAD'.execute().text.trim()
localLibrary.allowVersionOverride = false
GlobalLibraries.get().setLibraries(Collections.singletonList(localLibrary))
}

private void configureSlaves() {
rule.jenkins.numExecutors = 0
rule.jenkins.save()
rule.createOnlineSlave()
rule.createOnlineSlave()
}
}
---

Sometimes running theseBuild log
[Pipeline] withCredentials
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.lang.NoSuchMethodError: org.jvnet.tiger_types.Types.bind(Ljava/lang/reflect/Type;Ljava/lang/reflect/GenericDeclaration;Ljava/lang/reflect/ParameterizedType;)Ljava/lang/reflect/Type;
at org.kohsuke.stapler.ClassDescriptor.findMethods(ClassDescriptor.java:173)
at org.kohsuke.stapler.ClassDescriptor.findMethods(ClassDescriptor.java:147)
at org.kohsuke.stapler.ClassDescriptor.<init>(ClassDescriptor.java:85)
at org.jenkinsci.plugins.structs.describable.DescribableModel.<init>(DescribableModel.java:122)
at org.jenkinsci.plugins.structs.describable.UninstantiatedDescribable.instantiate(UninstantiatedDescribable.java:166)
at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:372)
at org.jenkinsci.plugins.structs.describable.DescribableModel.coerceList(DescribableModel.java:463)
at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:365)
at org.jenkinsci.plugins.structs.describable.DescribableModel.buildArguments(DescribableModel.java:318)
at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:259)
at org.jenkinsci.plugins.workflow.steps.StepDescriptor.newInstance(StepDescriptor.java:201)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:205)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:150)
at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1278)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1138)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:18)
at com.mkobit.jenkins.pipelines.docker.DockerSupport.ensureImagePresent(/var/lib/jenkins/workspace/utilities_git-dir-traversal-X6RAXJN7IA4NTXCT5HTZLDWF3EMB2AV4RCPAUH6BVTWESOYJ47RQ/build/integrationTestTmp/jenkinsTests.tmp/jenkins4639428473108692947test/jobs/project/builds/1/libs/pipelineUtilities/src/com/mkobit/jenkins/pipelines/docker/DockerSupport.groovy:216)
at com.mkobit.jenkins.pipelines.BaseScriptSupport.withScriptDelegate(file:/var/lib/jenkins/workspace/utilities_git-dir-traversal-X6RAXJN7IA4NTXCT5HTZLDWF3EMB2AV4RCPAUH6BVTWESOYJ47RQ/build/integrationTestTmp/jenkinsTests.tmp/jenkins4639428473108692947test/jobs/project/builds/1/libs/pipelineUtilities/src/com/mkobit/jenkins/pipelines/BaseScriptSupport.groovy:58)
at com.mkobit.jenkins.pipelines.docker.DockerSupport.ensureImagePresent(/var/lib/jenkins/workspace/utilities_git-dir-traversal-X6RAXJN7IA4NTXCT5HTZLDWF3EMB2AV4RCPAUH6BVTWESOYJ47RQ/build/integrationTestTmp/jenkinsTests.tmp/jenkins4639428473108692947test/jobs/project/builds/1/libs/pipelineUtilities/src/com/mkobit/jenkins/pipelines/docker/DockerSupport.groovy:204)
at com.mkobit.jenkins.pipelines.docker.DockerSupport.insideContainer(/var/lib/jenkins/workspace/utilities_git-dir-traversal-X6RAXJN7IA4NTXCT5HTZLDWF3EMB2AV4RCPAUH6BVTWESOYJ47RQ/build/integrationTestTmp/jenkinsTests.tmp/jenkins4639428473108692947test/jobs/project/builds/1/libs/pipelineUtilities/src/com/mkobit/jenkins/pipelines/docker/DockerSupport.groovy:162)
at com.mkobit.jenkins.pipelines.BaseScriptSupport.withScriptDelegate(file:/var/lib/jenkins/workspace/utilities_git-dir-traversal-X6RAXJN7IA4NTXCT5HTZLDWF3EMB2AV4RCPAUH6BVTWESOYJ47RQ/build/integrationTestTmp/jenkinsTests.tmp/jenkins4639428473108692947test/jobs/project/builds/1/libs/pipelineUtilities/src/com/mkobit/jenkins/pipelines/BaseScriptSupport.groovy:58)
at com.mkobit.jenkins.pipelines.docker.DockerSupport.insideContainer(/var/lib/jenkins/workspace/utilities_git-dir-traversal-X6RAXJN7IA4NTXCT5HTZLDWF3EMB2AV4RCPAUH6BVTWESOYJ47RQ/build/integrationTestTmp/jenkinsTests.tmp/jenkins4639428473108692947test/jobs/project/builds/1/libs/pipelineUtilities/src/com/mkobit/jenkins/pipelines/docker/DockerSupport.groovy:157)
at com.mkobit.jenkins.pipelines.docker.DockerSupport.insideContainer(/var/lib/jenkins/workspace/utilities_git-dir-traversal-X6RAXJN7IA4NTXCT5HTZLDWF3EMB2AV4RCPAUH6BVTWESOYJ47RQ/build/integrationTestTmp/jenkinsTests.tmp/jenkins4639428473108692947test/jobs/project/builds/1/libs/pipelineUtilities/src/com/mkobit/jenkins/pipelines/docker/DockerSupport.groovy:74)
at com.mkobit.jenkins.pipelines.docker.DockerSupportIntegrationSpec.WorkflowScript.run(WorkflowScript:8)
at ___cps.transform___(Native Method)
at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57)
at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.java:46)
at com.cloudbees.groovy.cps.Next.step(Next.java:83)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:173)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:162)
at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)
at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)
at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:162)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)
at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Finished: FAILURE

------

Expected: is <SUCCESS>
but: was <FAILURE>
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
at org.junit.Assert.assertThat(Assert.java:956)
at org.jvnet.hudson.test.JenkinsRule.assertBuildStatus(JenkinsRule.java:1157)
at org.jvnet.hudson.test.JenkinsRule.assertBuildStatus(JenkinsRule.java:1163)
at org.jvnet.hudson.test.JenkinsRule.assertBuildStatusSuccess(JenkinsRule.java:1192)
at com.mkobit.jenkins.pipelines.docker.DockerSupportIntegrationSpec.Can run inside Docker Hub library image(DockerSupportIntegrationSpec.groovy:72)
---

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/a95469e2-3e42-4e44-8d44-5c04220c66f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running tests using jenkins-test-harness and running to java.lang.NoSuchMethodError: org.jvnet.tiger_types.Types.bind

Jesse Glick-4
On Fri, Aug 4, 2017 at 3:33 PM, Michael Kobit <[hidden email]> wrote:
> I see errors like
> java.lang.NoSuchMethodError:
> org.jvnet.tiger_types.Types.bind(Ljava/lang/reflect/Type;Ljava/lang/reflect/GenericDeclaration;Ljava/lang/reflect/ParameterizedType;)Ljava/lang/reflect/Type;.
> Anybody have any ideas?

Use plugin POM 2.31+ to find your mismatched dependencies.

> Some of build.gradle

…or you are on your own if you choose to use Gradle.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr04idHG6Q02C1SqUHALTQtH8bco_jRA5oGcJ-EGKUGkKA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running tests using jenkins-test-harness and running to java.lang.NoSuchMethodError: org.jvnet.tiger_types.Types.bind

Michael Kobit
Thanks Jesse, I'll have to take a look at the POM 2.31+ and see where I'm going wrong. I don't see it locally (generally) and it only happens on our CI server. I'm wondering if maybe I'm not configuring the plugin classpath for the test harness correctly.

Interestingly enough, when I run ./gradlew dependencies (see attached for full output) I do only see 2.2 on the dependency graph:

|    |    |    |    |    +--- org.jvnet:tiger-types:2.2

|    |    |    |    |    +--- org.jvnet:tiger-types:2.2


On Friday, August 4, 2017 at 3:04:55 PM UTC-5, Jesse Glick wrote:
On Fri, Aug 4, 2017 at 3:33 PM, Michael Kobit <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="OmLkd5XaBAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mko...@...> wrote:
> I see errors like
> java.lang.NoSuchMethodError:
> org.jvnet.tiger_types.Types.bind(Ljava/lang/reflect/Type;Ljava/lang/reflect/GenericDeclaration;Ljava/lang/reflect/ParameterizedType;)Ljava/lang/reflect/Type;.
> Anybody have any ideas?

Use plugin POM 2.31+ to find your mismatched dependencies.

> Some of build.gradle

…or you are on your own if you choose to use Gradle.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/b0a2264b-9de2-475e-9089-04db3ab78740%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

dependencies.txt (173K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running tests using jenkins-test-harness and running to java.lang.NoSuchMethodError: org.jvnet.tiger_types.Types.bind

Baptiste MATHUS
Not easy to double check because otp, but reminds me https://issues.jenkins-ci.org/browse/JENKINS-39689 

My 2 cents

Le 4 août 2017 22:49, "Michael Kobit" <[hidden email]> a écrit :
Thanks Jesse, I'll have to take a look at the POM 2.31+ and see where I'm going wrong. I don't see it locally (generally) and it only happens on our CI server. I'm wondering if maybe I'm not configuring the plugin classpath for the test harness correctly.

Interestingly enough, when I run ./gradlew dependencies (see attached for full output) I do only see 2.2 on the dependency graph:

|    |    |    |    |    +--- org.jvnet:tiger-types:2.2

|    |    |    |    |    +--- org.jvnet:tiger-types:2.2


On Friday, August 4, 2017 at 3:04:55 PM UTC-5, Jesse Glick wrote:
On Fri, Aug 4, 2017 at 3:33 PM, Michael Kobit <[hidden email]> wrote:
> I see errors like
> java.lang.NoSuchMethodError:
> org.jvnet.tiger_types.Types.bind(Ljava/lang/reflect/Type;Ljava/lang/reflect/GenericDeclaration;Ljava/lang/reflect/ParameterizedType;)Ljava/lang/reflect/Type;.
> Anybody have any ideas?

Use plugin POM 2.31+ to find your mismatched dependencies.

> Some of build.gradle

…or you are on your own if you choose to use Gradle.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/b0a2264b-9de2-475e-9089-04db3ab78740%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANWgJS7Webs_V2ThSw3V18-kBRLeXJ65W314u6tH%2BwfjEQQ31w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running tests using jenkins-test-harness and running to java.lang.NoSuchMethodError: org.jvnet.tiger_types.Types.bind

Michael Kobit
It only seems to happen sometimes, and mostly on our CI servers. The build always seems to fail at that withCredentials step that I have in my test, but that may be unrelated I don't think we have that plugin 

I'm wondering if I'm not configuring the classpath correctly for the JenkinsRule. How exactly does it locate and load plugins? In my case both the JAR dependencies and HPI dependencies appear to be on the classpath but I'm wondering if there is some load order problem? Or maybe I'm doing something wrong to prepare the JenkinsRule instance?

On Friday, August 4, 2017 at 4:23:13 PM UTC-5, Baptiste Mathus wrote:
Not easy to double check because otp, but reminds me <a href="https://issues.jenkins-ci.org/browse/JENKINS-39689" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org%2Fbrowse%2FJENKINS-39689\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEDxW5f7k6oYw84lubwDMMYqqHZRA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org%2Fbrowse%2FJENKINS-39689\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEDxW5f7k6oYw84lubwDMMYqqHZRA&#39;;return true;">https://issues.jenkins-ci.org/browse/JENKINS-39689 

My 2 cents

Le 4 août 2017 22:49, "Michael Kobit" <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="feI2VtveBAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mko...@...> a écrit :
Thanks Jesse, I'll have to take a look at the POM 2.31+ and see where I'm going wrong. I don't see it locally (generally) and it only happens on our CI server. I'm wondering if maybe I'm not configuring the plugin classpath for the test harness correctly.

Interestingly enough, when I run ./gradlew dependencies (see attached for full output) I do only see 2.2 on the dependency graph:

|    |    |    |    |    +--- org.jvnet:tiger-types:2.2

|    |    |    |    |    +--- org.jvnet:tiger-types:2.2


On Friday, August 4, 2017 at 3:04:55 PM UTC-5, Jesse Glick wrote:
On Fri, Aug 4, 2017 at 3:33 PM, Michael Kobit <[hidden email]> wrote:
> I see errors like
> java.lang.NoSuchMethodError:
> <a href="http://org.jvnet.tiger_types.Types.bi" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Forg.jvnet.tiger_types.Types.bi\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGxLsjr-vwUxVr-tsKMfcq_fdu98w&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Forg.jvnet.tiger_types.Types.bi\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGxLsjr-vwUxVr-tsKMfcq_fdu98w&#39;;return true;">org.jvnet.tiger_types.Types.bind(Ljava/lang/reflect/Type;Ljava/lang/reflect/GenericDeclaration;Ljava/lang/reflect/ParameterizedType;)Ljava/lang/reflect/Type;.
> Anybody have any ideas?

Use plugin POM 2.31+ to find your mismatched dependencies.

> Some of build.gradle

…or you are on your own if you choose to use Gradle.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="feI2VtveBAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-dev/b0a2264b-9de2-475e-9089-04db3ab78740%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/b0a2264b-9de2-475e-9089-04db3ab78740%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/b0a2264b-9de2-475e-9089-04db3ab78740%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-dev/b0a2264b-9de2-475e-9089-04db3ab78740%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/583b4bf5-fb12-45f2-8991-1952fba6efb7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running tests using jenkins-test-harness and running to java.lang.NoSuchMethodError: org.jvnet.tiger_types.Types.bind

Michael Kobit
> but that may be unrelated I don't think we have that plugin 

I meant that I don't think we don't have the Docker plugin in the previously mentioned issue.

If I look at a different plugin (the Ansicolor plugin for this example) where I am using plugin parent version 2.25, some plugin HPIs are copied to target/jenkins-for-test/WEB-INF/plugins . Just throwing out ideas as maybe it will spark something that I am clearly doing wrong.

On Monday, August 7, 2017 at 8:44:57 AM UTC-5, Michael Kobit wrote:
It only seems to happen sometimes, and mostly on our CI servers. The build always seems to fail at that withCredentials step that I have in my test, but that may be unrelated I don't think we have that plugin 

I'm wondering if I'm not configuring the classpath correctly for the JenkinsRule. How exactly does it locate and load plugins? In my case both the JAR dependencies and HPI dependencies appear to be on the classpath but I'm wondering if there is some load order problem? Or maybe I'm doing something wrong to prepare the JenkinsRule instance?

On Friday, August 4, 2017 at 4:23:13 PM UTC-5, Baptiste Mathus wrote:
Not easy to double check because otp, but reminds me <a href="https://issues.jenkins-ci.org/browse/JENKINS-39689" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org%2Fbrowse%2FJENKINS-39689\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEDxW5f7k6oYw84lubwDMMYqqHZRA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org%2Fbrowse%2FJENKINS-39689\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEDxW5f7k6oYw84lubwDMMYqqHZRA&#39;;return true;">https://issues.jenkins-ci.org/browse/JENKINS-39689 

My 2 cents

Le 4 août 2017 22:49, "Michael Kobit" <[hidden email]> a écrit :
Thanks Jesse, I'll have to take a look at the POM 2.31+ and see where I'm going wrong. I don't see it locally (generally) and it only happens on our CI server. I'm wondering if maybe I'm not configuring the plugin classpath for the test harness correctly.

Interestingly enough, when I run ./gradlew dependencies (see attached for full output) I do only see 2.2 on the dependency graph:

|    |    |    |    |    +--- org.jvnet:tiger-types:2.2

|    |    |    |    |    +--- org.jvnet:tiger-types:2.2


On Friday, August 4, 2017 at 3:04:55 PM UTC-5, Jesse Glick wrote:
On Fri, Aug 4, 2017 at 3:33 PM, Michael Kobit <[hidden email]> wrote:
> I see errors like
> java.lang.NoSuchMethodError:
> <a href="http://org.jvnet.tiger_types.Types.bi" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Forg.jvnet.tiger_types.Types.bi\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGxLsjr-vwUxVr-tsKMfcq_fdu98w&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Forg.jvnet.tiger_types.Types.bi\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGxLsjr-vwUxVr-tsKMfcq_fdu98w&#39;;return true;">org.jvnet.tiger_types.Types.bind(Ljava/lang/reflect/Type;Ljava/lang/reflect/GenericDeclaration;Ljava/lang/reflect/ParameterizedType;)Ljava/lang/reflect/Type;.
> Anybody have any ideas?

Use plugin POM 2.31+ to find your mismatched dependencies.

> Some of build.gradle

…or you are on your own if you choose to use Gradle.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-dev/b0a2264b-9de2-475e-9089-04db3ab78740%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/b0a2264b-9de2-475e-9089-04db3ab78740%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/b0a2264b-9de2-475e-9089-04db3ab78740%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-dev/b0a2264b-9de2-475e-9089-04db3ab78740%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/acc6fc3b-fd43-45cb-add7-f8055287bae3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running tests using jenkins-test-harness and running to java.lang.NoSuchMethodError: org.jvnet.tiger_types.Types.bind

Jesse Glick-4
In reply to this post by Michael Kobit
On Mon, Aug 7, 2017 at 9:44 AM, Michael Kobit <[hidden email]> wrote:
> I'm wondering if I'm not configuring the classpath correctly for the
> JenkinsRule. How exactly does it locate and load plugins?

Whatever the Java classpath is when running tests, that is what it loads.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr2LkhNHAVcMGKuU_FJtrW4G8RD41TpU62qi2WSPzFhGjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running tests using jenkins-test-harness and running to java.lang.NoSuchMethodError: org.jvnet.tiger_types.Types.bind

Michael Kobit
Thanks again, Jesse.

With yours and Baptiste help, I figured this out.
It came from the https://plugins.jenkins.io/docker-traceability plugin and the docker-java-shaded JAR vended by it. I removed that plugin as a dependency and it seems to consistently succeed now.
I'm wondering if the failure came from classloading order between the Java on my laptop and the Java on our CI system (or maybe something seemingly random?)
Anyways, thanks again for the help.

Now I just have to figure out the java.lang.InstantiationException: java.lang.NoClassDefFoundError: org/jenkinsci/main/modules/sshd/SshCommandFactory that pops up!

On Monday, August 7, 2017 at 11:00:31 AM UTC-5, Jesse Glick wrote:
On Mon, Aug 7, 2017 at 9:44 AM, Michael Kobit <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="8ISIBf24BQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mko...@...> wrote:
> I'm wondering if I'm not configuring the classpath correctly for the
> JenkinsRule. How exactly does it locate and load plugins?

Whatever the Java classpath is when running tests, that is what it loads.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/5cbe92a9-fd67-4b12-b7e9-cca388c080ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...