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

JenkinsRule initialization failed on a platform un-supported by JNA

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • PPC64, HP-UX etc.

      org.jvnet.hudson.test.JenkinsRule contains static initialization block with:

              if (!Functions.isWindows()) {
                  try {
                      GNUCLibrary.LIBC.unsetenv("MAVEN_OPTS");
                      GNUCLibrary.LIBC.unsetenv("MAVEN_DEBUG_OPTS");
                  } catch (Exception e) {
                      LOGGER.log(Level.WARNING,"Failed to cancel out MAVEN_OPTS",e);
                  }
              }
      

      This part of code doesn't work as expected in the situation when loading "c" library fails. The exception can't be caught in the static block.

      Above means a testsuite can't be executed on by JNA un-supported platform when JenkinsRule is used (obviously by many plug-ins).

      Stacktrace looks similar like:

      java.lang.UnsatisfiedLinkError: Native library (com/sun/jna/hp-ux-ia64n/libjnidispatch.so) not found in resource path ([file:/hudson_workspace/workspace/HTS-ProcCleanerCI/target/surefire/surefirebooter7685486171447239626.jar])
       	at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:776)
       	at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:736)
       	at com.sun.jna.Native.<clinit>(Native.java:131)
       	at org.jvnet.hudson.test.JenkinsRule.<clinit>(JenkinsRule.java:2129)
       	at org.jenkinsci.plugins.proccleaner.PsCleanerTest.<init>(PsCleanerTest.java:68)
      

      PsCleanerTest.java:68 : @Rule public JenkinsRule j = new JenkinsRule();
      JenkinsRule.java:2129 : GNUCLibrary.LIBC.unsetenv("MAVEN_OPTS");

            Unassigned Unassigned
            pajasoft Pavel JanouĊĦek
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: