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

Improve Error handling of junit test result report, when encounter invalid file

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • junit-plugin
    • None
    • Platform: All, OS: All

      When we configure a job, one user entered a wrong regular expression to 'Public
      Junit test result report' - 'Test report XMLs' section to include some files
      which are not junit test result files and not xml format either. Then job
      throws excpetion with the trace, which is coped at the bottom.

      It would be nice that hudson can handle the non-junit files more gracefully –
      can give user friendly error msg instead of displaying trace file.

      ======================================================
      BUILD SUCCESSFUL
      Total time: 955 minutes 11 seconds
      Archiving artifacts
      Recording test results
      ERROR: Failed to archive JUnit reports
      hudson.util.IOException2: remote file operation failed
      at hudson.FilePath.act(FilePath.java:596)
      at hudson.tasks.junit.JUnitResultArchiver.perform(JUnitResultArchiver.java:82)
      at
      hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:372)
      at
      hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:360)
      at hudson.model.Build$RunnerImpl.post2(Build.java:183)
      at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:345)
      at hudson.model.Run.run(Run.java:943)
      at hudson.model.Build.run(Build.java:112)
      at hudson.model.ResourceController.execute(ResourceController.java:93)
      at hudson.model.Executor.run(Executor.java:119)
      Caused by: hudson.util.IOException2: Failed to read
      /export/home/tester/hudson/data/workspace/BR_INT_KNL_TC6_GroupA/BR_INT_KNL_TC6/anet/search-test/caches/anet-index/beef/_0.cfs
      Is this really a JUnit report file? Your configuration must be matching too many
      files
      at hudson.tasks.junit.TestResult.parse(TestResult.java:168)
      at hudson.tasks.junit.TestResult.parse(TestResult.java:118)
      at hudson.tasks.junit.TestResult.<init>(TestResult.java:95)
      at hudson.tasks.junit.JUnitResultArchiver$1.invoke(JUnitResultArchiver.java:95)
      at hudson.tasks.junit.JUnitResultArchiver$1.invoke(JUnitResultArchiver.java:82)
      at hudson.FilePath$FileCallableWrapper.call(FilePath.java:1583)
      at hudson.remoting.UserRequest.perform(UserRequest.java:97)
      at hudson.remoting.UserRequest.perform(UserRequest.java:46)
      at hudson.remoting.Request$2.run(Request.java:236)
      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: org.dom4j.DocumentException: Error on line 1 of document
      file:///export/home/tester/hudson/data/workspace/BR_INT_KNL_TC6_GroupA/BR_INT_KNL_TC6/anet/search-test/caches/anet-index/beef/_0.cfs
      : Content is not allowed in prolog. Nested exception: Content is not allowed in
      prolog.
      at org.dom4j.io.SAXReader.read(SAXReader.java:482)
      at org.dom4j.io.SAXReader.read(SAXReader.java:264)
      at hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:89)
      at hudson.tasks.junit.TestResult.parse(TestResult.java:162)
      ... 14 more
      Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
      at
      com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
      at
      com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:215)
      at
      com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:386)
      at
      com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
      at
      com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1438)
      at
      com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(XMLDocumentScannerImpl.java:899)
      at
      com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
      at
      com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
      at
      com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
      at
      com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
      at org.dom4j.io.SAXReader.read(SAXReader.java:465)
      ... 17 more
      Sending e-mails to: xxxx@xxx.com

            Unassigned Unassigned
            echeng echeng
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: