upgrade plugin to jenkins 1.494 -> JenkinsRule tests fail

156 views
Skip to first unread message

Matt Sheehan

unread,
Oct 25, 2013, 3:59:29 PM10/25/13
to jenkin...@googlegroups.com
After upgrading a plugin from Jenkins 1.480 to 1.494, all tests using JenkinsRule fail with the below stacktrace. Seems to be failing because Jenkins.getExtensionList is empty. Does anyone know what might have changed? 

The plugin is using the latest version of the gradle-jpi-plugin. There's a simple demo here: https://github.com/sheehan/jenkins-test

org.jvnet.hudson.reactor.ReactorException: java.lang.Error: java.lang.reflect.InvocationTargetException
	at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:246)
	at jenkins.InitReactorRunner.run(InitReactorRunner.java:43)
	at jenkins.model.Jenkins.executeReactor(Jenkins.java:893)
	at jenkins.model.Jenkins.<init>(Jenkins.java:795)
	at hudson.model.Hudson.<init>(Hudson.java:81)
	at org.jvnet.hudson.test.JenkinsRule.newHudson(JenkinsRule.java:528)
	at org.jvnet.hudson.test.JenkinsRule.before(JenkinsRule.java:321)
	at org.jvnet.hudson.test.JenkinsRule$2.evaluate(JenkinsRule.java:472)
	at org.junit.rules.RunRules.evaluate(RunRules.java:18)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:80)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:47)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:69)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:49)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
	at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
	at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:103)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:355)
	at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
	at java.lang.Thread.run(Thread.java:695)
Caused by: java.lang.Error: java.lang.reflect.InvocationTargetException
	at hudson.init.InitializerFinder.invoke(InitializerFinder.java:124)
	at hudson.init.InitializerFinder$TaskImpl.run(InitializerFinder.java:184)
	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259)
	at jenkins.model.Jenkins$7.runTask(Jenkins.java:882)
	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187)
	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
	... 3 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at hudson.init.InitializerFinder.invoke(InitializerFinder.java:120)
	... 8 more
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.RangeCheck(ArrayList.java:547)
	at java.util.ArrayList.get(ArrayList.java:322)
	at hudson.ExtensionList.get(ExtensionList.java:153)
	at hudson.PluginManager$PluginUpdateMonitor.getInstance(PluginManager.java:1058)
	at hudson.maven.PluginImpl.init(PluginImpl.java:54)
	... 13 more


Kamal Mettananda

unread,
Oct 27, 2013, 6:14:38 AM10/27/13
to jenkin...@googlegroups.com
I noticed that you have updated to 1.494.

Is there a possibility of upgrading a bit further to a version 1.499 or later; and see whether this issue is resolved? I remember there was a fix in 1.499 which was related to JenkinsRule.

---
Kamal Mettananda
www.digizol.com

Matt Sheehan

unread,
Oct 27, 2013, 10:06:28 PM10/27/13
to jenkin...@googlegroups.com
I see the same error up through 1.534. After that I get a new error about "Could not find org.jenkins-ci.main:ui-samples-plugin".

Jesse Glick

unread,
Oct 28, 2013, 9:40:18 AM10/28/13
to jenkin...@googlegroups.com
On Sun, Oct 27, 2013 at 10:06 PM, Matt Sheehan <mr.sh...@gmail.com> wrote:
> I see the same error up through 1.534. After that I get a new error

Better, probably thanks to my:

https://github.com/jenkinsci/jenkins/commit/ea85489a0a8eafaf70917af8079a1839b264c1e7

and/or

https://github.com/jenkinsci/jenkins/commit/c01f2564eb5f847c0f92d7aa0c4e3702fc736811

> "Could not find org.jenkins-ci.main:ui-samples-plugin".

Do you mention ui-samples-plugin in your POM anywhere? Do you use an
old version of maven-hpi-plugin? Or it sounds like you are using
gradle-jpi-plugin; probably that has not been kept up to date with the
many changes occurring in maven-hpi-plugin.
Reply all
Reply to author
Forward
0 new messages