Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-73281

Fix BOM sample plugin tests on EE 8

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Major Major
    • subversion-plugin
    • None
    • 1265.v4b_6d7cd94421

      When running jenkinsci/bom's sample-plugin tests on Java 17, an EE 8 core, and an EE 8 test harness; that is,

      diff --git a/pom.xml b/pom.xml
      index 1082d935..37836d8a 100644
      --- a/pom.xml
      +++ b/pom.xml
      @@ -35,6 +35,8 @@
           <changelist>999999-SNAPSHOT</changelist>
           <gitHubRepo>jenkinsci/bom</gitHubRepo>
           <spotless.check.skip>false</spotless.check.skip>
      +    <!-- TODO JENKINS-73121 until in parent POM -->
      +    <maven.compiler.release>17</maven.compiler.release>
         </properties>
         <repositories>
           <repository>
      diff --git a/sample-plugin/pom.xml b/sample-plugin/pom.xml
      index 813b9540..6bcf3dd0 100644
      --- a/sample-plugin/pom.xml
      +++ b/sample-plugin/pom.xml
      @@ -14,8 +14,11 @@
         <properties>
           <changelist>999999-SNAPSHOT</changelist>
           <bom>weekly</bom>
      -    <jenkins.version>2.461</jenkins.version>
      +    <!-- TODO https://ci.jenkins.io/job/Core/job/jenkins/job/prototype/ -->
      +    <jenkins.version>2.462-rc35025.fb_98b_5eca_71b_</jenkins.version>
           <spotless.check.skip>false</spotless.check.skip>
      +    <!-- TODO https://github.com/jenkinsci/jenkins-test-harness/pull/762 -->
      +    <jenkins-test-harness.version>2217.v58105ec9b_db_0</jenkins-test-harness.version>
         </properties>
         <dependencyManagement>
           <dependencies>
      

      I get the following bizarre error:

      [INFO] -------------------------------------------------------
      [INFO]  T E S T S
      [INFO] -------------------------------------------------------
      Running tests for io.jenkins.tools.bom:sample:999999-SNAPSHOT
      Running tests for io.jenkins.tools.bom:sample:999999-SNAPSHOT
      [INFO] Running io.jenkins.tools.bom.sample.InjectedTest
      Jun 07, 2024 1:04:40 PM org.jvnet.hudson.test.WarExploder explode
      INFO: Exploding /home/basil/.m2/repository/org/jenkins-ci/main/jenkins-war/2.462-rc35025.fb_98b_5eca_71b_/jenkins-war-2.462-rc35025.fb_98b_5eca_71b_.war into /home/basil/src/jenkinsci/bom/sample-plugin/target/jenkins-for-test
      Jun 07, 2024 1:04:42 PM org.eclipse.jetty.ee8.nested.ContextHandler setContextPath
      WARNING: Empty contextPath
      Jun 07, 2024 1:04:42 PM org.eclipse.jetty.server.Server doStart
      INFO: jetty-12.0.10; built: 2024-05-30T04:40:36.563Z; git: 26106dfc84a03ddb6216062fe33b047fc332d0ce; jvm 21.0.3+9-LTS
      Jun 07, 2024 1:04:42 PM org.eclipse.jetty.ee8.webapp.WebAppContext doStart
      WARNING: Failed startup of context ojht.HudsonTestCase$@991cbde{ROOT,/,file:///home/basil/src/jenkinsci/bom/sample-plugin/target/jenkins-for-test/,false}{/home/basil/src/jenkinsci/bom/sample-plugin/target/jenkins-for-test}
      java.util.ServiceConfigurationError: java.nio.file.spi.FileSystemProvider: Provider org.apache.sshd.sftp.client.fs.SftpFileSystemProvider could not be instantiated
      	at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:586)
      	at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:813)
      	at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:729)
      	at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1403)
      	at java.base/java.nio.file.spi.FileSystemProvider.loadInstalledProviders(FileSystemProvider.java:156)
      	at java.base/java.nio.file.spi.FileSystemProvider$1.run(FileSystemProvider.java:207)
      	at java.base/java.nio.file.spi.FileSystemProvider$1.run(FileSystemProvider.java:204)
      	at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
      	at java.base/java.nio.file.spi.FileSystemProvider.installedProviders(FileSystemProvider.java:204)
      	at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:336)
      	at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:288)
      	at org.eclipse.jetty.util.resource.FileSystemPool.mount(FileSystemPool.java:116)
      	at org.eclipse.jetty.util.resource.ResourceFactoryInternals$CompositeResourceFactory.mountIfNeeded(ResourceFactoryInternals.java:268)
      	at org.eclipse.jetty.util.resource.ResourceFactoryInternals$CompositeResourceFactory.newResource(ResourceFactoryInternals.java:225)
      	at org.eclipse.jetty.util.resource.ResourceFactoryInternals$LifeCycle.newResource(ResourceFactoryInternals.java:171)
      	at org.eclipse.jetty.util.resource.ResourceFactory.newClassLoaderResource(ResourceFactory.java:243)
      	at org.eclipse.jetty.util.resource.ResourceFactory.newClassLoaderResource(ResourceFactory.java:265)
      	at org.eclipse.jetty.ee8.webapp.WebXmlConfiguration.preConfigure(WebXmlConfiguration.java:47)
      	at org.eclipse.jetty.ee8.webapp.Configurations.preConfigure(Configurations.java:407)
      	at org.eclipse.jetty.ee8.webapp.WebAppContext.preConfigure(WebAppContext.java:470)
      	at org.eclipse.jetty.ee8.webapp.WebAppContext.doStart(WebAppContext.java:500)
      	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
      	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
      	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
      	at org.eclipse.jetty.server.Handler$Abstract.doStart(Handler.java:491)
      	at org.eclipse.jetty.server.handler.ContextHandler.lambda$doStart$0(ContextHandler.java:725)
      	at org.eclipse.jetty.server.handler.ContextHandler$ScopedContext.call(ContextHandler.java:1237)
      	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:725)
      	at org.eclipse.jetty.ee8.nested.ContextHandler$CoreContextHandler.doStart(ContextHandler.java:2151)
      	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
      	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
      	at org.eclipse.jetty.server.Server.start(Server.java:624)
      	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:120)
      	at org.eclipse.jetty.server.Handler$Abstract.doStart(Handler.java:491)
      	at org.eclipse.jetty.server.Server.doStart(Server.java:565)
      	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
      	at org.jvnet.hudson.test.HudsonTestCase.createWebServer(HudsonTestCase.java:579)
      	at org.jvnet.hudson.test.HudsonTestCase.newHudson(HudsonTestCase.java:526)
      	at org.jvnet.hudson.test.HudsonTestCase.setUp(HudsonTestCase.java:345)
      	at org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite.setUp(JellyTestSuiteBuilder.java:130)
      	at org.jvnet.hudson.test.junit.GroupedTest.run(GroupedTest.java:49)
      	at junit.framework.TestSuite.runTest(TestSuite.java:241)
      	at junit.framework.TestSuite.run(TestSuite.java:236)
      	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:90)
      	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
      	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
      	at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:42)
      	at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80)
      	at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:72)
      	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:198)
      	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:169)
      	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:93)
      	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:58)
      	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:141)
      	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:57)
      	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:103)
      	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85)
      	at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47)
      	at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:56)
      	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184)
      	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148)
      	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:120)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385)
      	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
      	at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)
      Caused by: java.lang.NoClassDefFoundError: org/apache/sshd/common/future/Cancellable
      	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
      	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027)
      	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
      	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
      	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
      	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
      	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
      	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
      	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
      	at org.apache.sshd.sftp.client.fs.SftpFileSystemProvider.<init>(SftpFileSystemProvider.java:189)
      	at org.apache.sshd.sftp.client.fs.SftpFileSystemProvider.<init>(SftpFileSystemProvider.java:164)
      	at org.apache.sshd.sftp.client.fs.SftpFileSystemProvider.<init>(SftpFileSystemProvider.java:160)
      	at org.apache.sshd.sftp.client.fs.SftpFileSystemProvider.<init>(SftpFileSystemProvider.java:156)
      	at org.apache.sshd.sftp.client.fs.SftpFileSystemProvider.<init>(SftpFileSystemProvider.java:148)
      	at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
      	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
      	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
      	at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:789)
              ... 64 more
      Caused by: java.lang.ClassNotFoundException: org.apache.sshd.common.future.Cancellable
      	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
      	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
      	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
              ... 82 more
      […]
      INFO: Jenkins stopped
      Jun 07, 2024 1:04:51 PM org.jvnet.hudson.test.TemporaryDirectoryAllocator dispose
      INFO: deleting /home/basil/src/jenkinsci/bom/sample-plugin/target/tmp/j h1467235081916344561
      [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 11.56 s <<< FAILURE! -- in io.jenkins.tools.bom.sample.InjectedTest
      [ERROR] org.jvnet.hudson.test.junit.FailedTest -- Time elapsed: 0.004 s <<< ERROR!
      org.htmlunit.FailingHttpStatusCodeException: 503 Service Unavailable for http://localhost:44441/closures/?uuid=165c31d1-613e-4b3a-bf6e-5cea1992657b
      	at org.htmlunit.WebClient.throwFailingHttpStatusCodeExceptionIfNecessary(WebClient.java:708)
      	at org.htmlunit.WebClient.getPage(WebClient.java:471)
      	at org.htmlunit.WebClient.getPage(WebClient.java:368)
      	at org.htmlunit.WebClient.getPage(WebClient.java:506)
      	at org.htmlunit.WebClient.getPage(WebClient.java:488)
      	at org.jvnet.hudson.test.HudsonTestCase$WebClient.goTo(HudsonTestCase.java:1712)
      	at org.jvnet.hudson.test.HudsonTestCase$WebClient.goTo(HudsonTestCase.java:1698)
      	at org.jvnet.hudson.test.HudsonTestCase$WebClient.executeOnServer(HudsonTestCase.java:1595)
      	at org.jvnet.hudson.test.HudsonTestCase.executeOnServer(HudsonTestCase.java:1430)
      	at org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite.runGroupedTests(JellyTestSuiteBuilder.java:144)
      	at org.jvnet.hudson.test.junit.GroupedTest.run(GroupedTest.java:51)
      	at junit.framework.TestSuite.runTest(TestSuite.java:241)
      	at junit.framework.TestSuite.run(TestSuite.java:236)
      
      [INFO] 
      [INFO] Results:
      [INFO] 
      [ERROR] Errors: 
      [ERROR]   FailedTest » FailingHttpStatusCode 503 Service Unavailable for http://localhost:44441/closures/?uuid=165c31d1-613e-4b3a-bf6e-5cea1992657b
      [INFO] 
      [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
      

      As far as I can tell this is something weird in mina-sshd-api-sftp, as I can work around the problem with:

      diff --git a/sample-plugin/pom.xml b/sample-plugin/pom.xml
      index 6bcf3dd0..ffeedc82 100644
      --- a/sample-plugin/pom.xml
      +++ b/sample-plugin/pom.xml
      @@ -401,6 +401,13 @@
             <groupId>io.jenkins.plugins.mina-sshd-api</groupId>
             <artifactId>mina-sshd-api-sftp</artifactId>
             <scope>test</scope>
      +      <exclusions>
      +        <!-- TODO needs triage -->
      +        <exclusion>
      +          <groupId>org.apache.sshd</groupId>
      +          <artifactId>sshd-sftp</artifactId>
      +        </exclusion>
      +      </exclusions>
           </dependency>
           <dependency>
             <groupId>org.6wind.jenkins</groupId>
      

      Obviously this workaround is unsatisfactory. The root cause should be investigated and a proper fix developed.

            basil Basil Crow
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: