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

xunit/cppunit causes exception when trying to scan a non-accessible directory

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: xunit-plugin
    • Labels:
      None
    • Environment:
      Linux
    • Similar Issues:

      Description

      In our build system we use what we called virtual packages which create
      symlinks that point out of the build tree.

      In the exception message fragment:

      Caused by: IO error scanning directory '/work/hudson/workspace/Central_Processor/trunk/3rdParty/openmpi/trunk/install/lib/ssl/private'

      The path:
      /work/hudson/workspace/Central_Processor/trunk/3rdParty/openmpi/trunk/install
      is a symlink to /usr.

      Our CppUnit Pattern '*/tests/-results.xml' means that it tries to explore
      the entire /usr hierarchy and comes across directories that it cannot access.

      Ok in our case we can avoid this by restricting our CppUnit Pattern to only
      one part of the tree which (by definition) cannot contain virtual packages
      and is only place where unit tests are found.

      However I do not think an exception is the correct thing to do.
      It would be better to just log inaccessible directories and continue.
      Yes ours is unusual case but it is conceivable that a build system could
      create inaccessible directories even within the checked out tree.

      Also Hudson reported everything ok and it was only by examining the console
      log that this problem was discovered.

      The last part of the console message is given below.
      ==========================================================================
      Result Summary:
      ============================
      simple PASS
      [xUnit] Starting to record.
      [xUnit] [CppUnit] - Use the embedded style sheet.
      ERROR: Publisher com.thalesgroup.hudson.plugins.xunit.XUnitPublisher aborted due to exception
      hudson.util.IOException2: The plugin hasn't been performed correctly.
      at com.thalesgroup.hudson.plugins.xunit.XUnitPublisher.perform(XUnitPublisher.java:126)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:582)
      at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:563)
      at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:550)
      at hudson.model.Build$RunnerImpl.post2(Build.java:152)
      at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528)
      at hudson.model.Run.run(Run.java:1233)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:122)
      Caused by: hudson.util.IOException2: remote file operation failed: /work/hudson/workspace/Central_Processor at hudson.remoting.Channel@4d885088:mymachine
      at hudson.FilePath.act(FilePath.java:690)
      at hudson.FilePath.act(FilePath.java:676)
      at com.thalesgroup.hudson.plugins.xunit.XUnitPublisher.perform(XUnitPublisher.java:99)
      ... 10 more
      Caused by: hudson.util.IOException2: Problem on converting into JUnit reports.
      at com.thalesgroup.hudson.plugins.xunit.transformer.XUnitTransformer.invoke(XUnitTransformer.java:154)
      at com.thalesgroup.hudson.plugins.xunit.transformer.XUnitTransformer.invoke(XUnitTransformer.java:57)
      at hudson.FilePath$FileCallableWrapper.call(FilePath.java:1962)
      at hudson.remoting.UserRequest.perform(UserRequest.java:114)
      at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      at hudson.remoting.Request$2.run(Request.java:270)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
      at java.util.concurrent.FutureTask.run(FutureTask.java:123)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: IO error scanning directory '/work/hudson/workspace/Central_Processor/trunk/3rdParty/openmpi/trunk/install/lib/ssl/private'
      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1065)
      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1100)
      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1100)
      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1100)
      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1100)
      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1100)
      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1100)
      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1100)
      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1100)
      at org.apache.tools.ant.DirectoryScanner.checkIncludePatterns(DirectoryScanner.java:856)
      at org.apache.tools.ant.DirectoryScanner.scan(DirectoryScanner.java:817)
      at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:435)
      at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:400)
      at com.thalesgroup.hudson.plugins.xunit.transformer.XUnitTransformer.findtReports(XUnitTransformer.java:189)
      at com.thalesgroup.hudson.plugins.xunit.transformer.XUnitTransformer.processTool(XUnitTransformer.java:272)
      at com.thalesgroup.hudson.plugins.xunit.transformer.XUnitTransformer.invoke(XUnitTransformer.java:134)
      ... 11 more
      Finished: SUCCESS

        Attachments

          Activity

          Hide
          gbois Gregory Boissinot added a comment -

          There is a new CppUnit Hudson plugin.
          The newest plugin is based on a new architecture
          Please could you test the new version and let me know if the problem persists?

          Show
          gbois Gregory Boissinot added a comment - There is a new CppUnit Hudson plugin. The newest plugin is based on a new architecture Please could you test the new version and let me know if the problem persists?
          Hide
          gbois Gregory Boissinot added a comment -

          Without any answers, I'm closing the issue.

          Show
          gbois Gregory Boissinot added a comment - Without any answers, I'm closing the issue.
          Hide
          wojo Wojciech Rynczuk added a comment -

          The plugin (v.1.54) fails and returns:
          [xUnit] [ERROR] - The plugin hasn't been performed correctly: hudson.util.IOException2: Failed to read C:\XXX\workspace\generatedJUnitFiles\JUnit\TEST-507924303.xml

          When it's trying to parse unrecognized xml format or the xml file is incomplete (which might happen in our case sometimes).

          E.g. one of the xml files that caused the problem was:
          <?xml version="1.0" encoding="UTF-8"?>
          <section name="Board Info" fontcolor="#000000">
          <field name="Board type" value="EMB1" />
          <field name="Bitstream ver" value="000091" />
          </section>

          It would be great if it wouldn't assert on broken xml files and generated some nice output showing this misbehavior.

          Show
          wojo Wojciech Rynczuk added a comment - The plugin (v.1.54) fails and returns: [xUnit] [ERROR] - The plugin hasn't been performed correctly: hudson.util.IOException2: Failed to read C:\XXX\workspace\generatedJUnitFiles\JUnit\TEST-507924303.xml When it's trying to parse unrecognized xml format or the xml file is incomplete (which might happen in our case sometimes). E.g. one of the xml files that caused the problem was: <?xml version="1.0" encoding="UTF-8"?> <section name="Board Info" fontcolor="#000000"> <field name="Board type" value="EMB1" /> <field name="Bitstream ver" value="000091" /> </section> It would be great if it wouldn't assert on broken xml files and generated some nice output showing this misbehavior.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/java/org/jenkinsci/plugins/xunit/XUnitPublisher.java
          http://jenkins-ci.org/commit/xunit-plugin/5128b7dc41c280a26388ace4ddae64266460e56a
          Log:
          Fix JENKINS-6200

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/org/jenkinsci/plugins/xunit/XUnitPublisher.java http://jenkins-ci.org/commit/xunit-plugin/5128b7dc41c280a26388ace4ddae64266460e56a Log: Fix JENKINS-6200
          Hide
          gbois Gregory Boissinot added a comment -

          Please test from 1.57.
          Be careful on options for each metrics.

          Show
          gbois Gregory Boissinot added a comment - Please test from 1.57. Be careful on options for each metrics.

            People

            • Assignee:
              gbois Gregory Boissinot
              Reporter:
              am50em am50em
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: