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

robotframework plugin throws exception on missing output-dir when the build fails

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: robot-plugin
    • Labels:
      None
    • Similar Issues:

      Description

      When a build fails, pybot will never be called because it's not necessary since the build failed. Because of this, there isn't a need to process robotframework reports since the output directory will never exist. So the idea is to not do anything upon a build failure.

      Here is the unnecessary exception:
      Robot results publisher started...
      -Parsing output xml:
      Failed!
      /var/lib/jenkins/jobs/XXXXX/workspace/my_robot_results does not exist.
      at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:483)
      at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:460)
      at hudson.plugins.robot.RobotParser$RobotParserCallable.invoke(RobotParser.java:65)
      at hudson.plugins.robot.RobotParser$RobotParserCallable.invoke(RobotParser.java:51)
      at hudson.FilePath.act(FilePath.java:920)
      at hudson.FilePath.act(FilePath.java:893)
      at hudson.plugins.robot.RobotParser.parse(RobotParser.java:46)
      at hudson.plugins.robot.RobotPublisher.parse(RobotPublisher.java:218)
      at hudson.plugins.robot.RobotPublisher.perform(RobotPublisher.java:241)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:745)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:709)
      at hudson.model.Build$BuildExecution.post2(Build.java:182)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:658)
      at hudson.model.Run.execute(Run.java:1734)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:231)
      Build step 'Publish Robot Framework test results' changed build result to FAILURE
      Finished: FAILURE

      It would be great to have an option to mark the build as failed or success whether or not the output_dir exists... So a check box in settings that says something along the lines of....
      "Don't mark build as failed if output_dir doesn't exist.

        Attachments

          Activity

          Hide
          jussi_malinen Jussi Malinen added a comment -

          Couldnt you do this so, that you would have robot tests a job that is executed automatically after your build job, if that passes? And so if the build fails, the robot job is never executed?

          Am I missing something important?

          Show
          jussi_malinen Jussi Malinen added a comment - Couldnt you do this so, that you would have robot tests a job that is executed automatically after your build job, if that passes? And so if the build fails, the robot job is never executed? Am I missing something important?
          Hide
          tjackson0 Tim Jackson added a comment -

          I do run robot tests after a build. Sometimes the robot tests time out or something else happens to prevent the output files from existing. This is when I get the unnecessary exception above. I would rather see something like, "Nothing to do, files do not exist" and continue gracefully.

          Show
          tjackson0 Tim Jackson added a comment - I do run robot tests after a build. Sometimes the robot tests time out or something else happens to prevent the output files from existing. This is when I get the unnecessary exception above. I would rather see something like, "Nothing to do, files do not exist" and continue gracefully.
          Hide
          tjackson0 Tim Jackson added a comment -

          There have been many closed bugs as "unable to reproduce" on this. JENKINS-18230, JENKINS-13911, JENKINS-23077.

          It is easy to reproduce. Start a RF job in Jenkins, and abort it by clicking the red X in the middle. The output files are now either missing or partial and your plugin throws an exception. You don't need to fix the cause of the output.xml file being broken, just handle it well.

          All you need to do is gracefully handle this exception and not pass it along. Post something like, "File is missing or corrupt. Nothing to do."

          instead of

          23:32:37 Robot results publisher started...
          23:32:37 -Parsing output xml:
          23:32:38 Failed!
          23:32:38 java.io.IOException: remote file operation failed: C:\Jenkins\workspace\BVT_CR6000 at hudson.remoting.Channel@44c7e452:CD-2768: hudson.remoting.ProxyException: java.io.IOException: Parsing of output xml failed!
          23:32:38 at hudson.FilePath.act(FilePath.java:986)
          23:32:38 at hudson.FilePath.act(FilePath.java:968)
          23:32:38 at hudson.plugins.robot.RobotParser.parse(RobotParser.java:47)
          23:32:38 at hudson.plugins.robot.RobotPublisher.parse(RobotPublisher.java:218)
          23:32:38 at hudson.plugins.robot.RobotPublisher.perform(RobotPublisher.java:241)
          23:32:38 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
          23:32:38 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
          23:32:38 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
          23:32:38 at hudson.model.Build$BuildExecution.post2(Build.java:185)
          23:32:38 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
          23:32:38 at hudson.model.Run.execute(Run.java:1763)
          23:32:38 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          23:32:38 at hudson.model.ResourceController.execute(ResourceController.java:98)
          23:32:38 at hudson.model.Executor.run(Executor.java:410)
          23:32:38 Caused by: hudson.remoting.ProxyException: java.io.IOException: Parsing of output xml failed!
          23:32:38 at hudson.plugins.robot.RobotParser$RobotParserCallable.invoke(RobotParser.java:101)
          23:32:38 at hudson.plugins.robot.RobotParser$RobotParserCallable.invoke(RobotParser.java:52)
          23:32:38 at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2719)
          23:32:38 at hudson.remoting.UserRequest.perform(UserRequest.java:120)
          23:32:38 at hudson.remoting.UserRequest.perform(UserRequest.java:48)
          23:32:38 at hudson.remoting.Request$2.run(Request.java:326)
          23:32:38 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
          23:32:38 at java.util.concurrent.FutureTask.run(Unknown Source)
          23:32:38 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          23:32:38 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          23:32:38 at hudson.remoting.Engine$1$1.run(Engine.java:62)
          23:32:38 at java.lang.Thread.run(Unknown Source)
          23:32:38 at ......remote call to CD-2768(Native Method)
          23:32:38 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416)
          23:32:38 at hudson.remoting.UserResponse.retrieve(UserRequest.java:220)
          23:32:38 at hudson.remoting.Channel.call(Channel.java:781)
          23:32:38 at hudson.FilePath.act(FilePath.java:979)
          23:32:38 ... 13 more
          23:32:38 Caused by: hudson.remoting.ProxyException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF; was expecting a close tag for element <msg>
          23:32:38 at [row,col

          {unknown-source}

          ]: [1755,52]
          23:32:38 at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:686)
          23:32:38 at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2730)
          23:32:38 at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
          23:32:38 at hudson.plugins.robot.RobotParser$RobotParserCallable.ignoreUntilStarts(RobotParser.java:197)
          23:32:38 at hudson.plugins.robot.RobotParser$RobotParserCallable.processTest(RobotParser.java:265)
          23:32:38 at hudson.plugins.robot.RobotParser$RobotParserCallable.processSuite(RobotParser.java:146)
          23:32:38 at hudson.plugins.robot.RobotParser$RobotParserCallable.parseResult(RobotParser.java:120)
          23:32:38 at hudson.plugins.robot.RobotParser$RobotParserCallable.invoke(RobotParser.java:96)
          23:32:38 at hudson.plugins.robot.RobotParser$RobotParserCallable.invoke(RobotParser.java:52)
          23:32:38 at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2719)
          23:32:38 at hudson.remoting.UserRequest.perform(UserRequest.java:120)
          23:32:38 at hudson.remoting.UserRequest.perform(UserRequest.java:48)
          23:32:38 at hudson.remoting.Request$2.run(Request.java:326)
          23:32:38 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
          23:32:38 at java.util.concurrent.FutureTask.run(Unknown Source)
          23:32:38 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          23:32:38 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          23:32:38 at hudson.remoting.Engine$1$1.run(Engine.java:62)
          23:32:38 at java.lang.Thread.run(Unknown Source)

          Show
          tjackson0 Tim Jackson added a comment - There have been many closed bugs as "unable to reproduce" on this. JENKINS-18230 , JENKINS-13911 , JENKINS-23077 . It is easy to reproduce. Start a RF job in Jenkins, and abort it by clicking the red X in the middle. The output files are now either missing or partial and your plugin throws an exception. You don't need to fix the cause of the output.xml file being broken, just handle it well. All you need to do is gracefully handle this exception and not pass it along. Post something like, "File is missing or corrupt. Nothing to do." instead of 23:32:37 Robot results publisher started... 23:32:37 -Parsing output xml: 23:32:38 Failed! 23:32:38 java.io.IOException: remote file operation failed: C:\Jenkins\workspace\BVT_CR6000 at hudson.remoting.Channel@44c7e452:CD-2768: hudson.remoting.ProxyException: java.io.IOException: Parsing of output xml failed! 23:32:38 at hudson.FilePath.act(FilePath.java:986) 23:32:38 at hudson.FilePath.act(FilePath.java:968) 23:32:38 at hudson.plugins.robot.RobotParser.parse(RobotParser.java:47) 23:32:38 at hudson.plugins.robot.RobotPublisher.parse(RobotPublisher.java:218) 23:32:38 at hudson.plugins.robot.RobotPublisher.perform(RobotPublisher.java:241) 23:32:38 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) 23:32:38 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782) 23:32:38 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723) 23:32:38 at hudson.model.Build$BuildExecution.post2(Build.java:185) 23:32:38 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668) 23:32:38 at hudson.model.Run.execute(Run.java:1763) 23:32:38 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 23:32:38 at hudson.model.ResourceController.execute(ResourceController.java:98) 23:32:38 at hudson.model.Executor.run(Executor.java:410) 23:32:38 Caused by: hudson.remoting.ProxyException: java.io.IOException: Parsing of output xml failed! 23:32:38 at hudson.plugins.robot.RobotParser$RobotParserCallable.invoke(RobotParser.java:101) 23:32:38 at hudson.plugins.robot.RobotParser$RobotParserCallable.invoke(RobotParser.java:52) 23:32:38 at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2719) 23:32:38 at hudson.remoting.UserRequest.perform(UserRequest.java:120) 23:32:38 at hudson.remoting.UserRequest.perform(UserRequest.java:48) 23:32:38 at hudson.remoting.Request$2.run(Request.java:326) 23:32:38 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) 23:32:38 at java.util.concurrent.FutureTask.run(Unknown Source) 23:32:38 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 23:32:38 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 23:32:38 at hudson.remoting.Engine$1$1.run(Engine.java:62) 23:32:38 at java.lang.Thread.run(Unknown Source) 23:32:38 at ......remote call to CD-2768(Native Method) 23:32:38 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416) 23:32:38 at hudson.remoting.UserResponse.retrieve(UserRequest.java:220) 23:32:38 at hudson.remoting.Channel.call(Channel.java:781) 23:32:38 at hudson.FilePath.act(FilePath.java:979) 23:32:38 ... 13 more 23:32:38 Caused by: hudson.remoting.ProxyException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF; was expecting a close tag for element <msg> 23:32:38 at [row,col {unknown-source} ]: [1755,52] 23:32:38 at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:686) 23:32:38 at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2730) 23:32:38 at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019) 23:32:38 at hudson.plugins.robot.RobotParser$RobotParserCallable.ignoreUntilStarts(RobotParser.java:197) 23:32:38 at hudson.plugins.robot.RobotParser$RobotParserCallable.processTest(RobotParser.java:265) 23:32:38 at hudson.plugins.robot.RobotParser$RobotParserCallable.processSuite(RobotParser.java:146) 23:32:38 at hudson.plugins.robot.RobotParser$RobotParserCallable.parseResult(RobotParser.java:120) 23:32:38 at hudson.plugins.robot.RobotParser$RobotParserCallable.invoke(RobotParser.java:96) 23:32:38 at hudson.plugins.robot.RobotParser$RobotParserCallable.invoke(RobotParser.java:52) 23:32:38 at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2719) 23:32:38 at hudson.remoting.UserRequest.perform(UserRequest.java:120) 23:32:38 at hudson.remoting.UserRequest.perform(UserRequest.java:48) 23:32:38 at hudson.remoting.Request$2.run(Request.java:326) 23:32:38 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) 23:32:38 at java.util.concurrent.FutureTask.run(Unknown Source) 23:32:38 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 23:32:38 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 23:32:38 at hudson.remoting.Engine$1$1.run(Engine.java:62) 23:32:38 at java.lang.Thread.run(Unknown Source)
          Hide
          samsun387 Kevin Yu added a comment -

          Agree. Similiar to the Archive Artifact plugin, it would be nice to provide a checkbox in the advance that does "Do not fail build if test output cannot be found."

          Show
          samsun387 Kevin Yu added a comment - Agree. Similiar to the Archive Artifact plugin, it would be nice to provide a checkbox in the advance that does "Do not fail build if test output cannot be found."
          Hide
          thomroby Roby Thomas added a comment -

          This also happens in case of our project which runs a Maven build. We need to skip tests related artifacts on "Maven Release" operation, and it records a failure here when it actually does not find the output files (in our case there will be none).

          Show
          thomroby Roby Thomas added a comment - This also happens in case of our project which runs a Maven build. We need to skip tests related artifacts on "Maven Release" operation, and it records a failure here when it actually does not find the output files (in our case there will be none).
          Hide
          jpiironen jpiironen added a comment -

          Hi,

          We've resumed development for the plugin and we're currently doing a release for the more urgent bugs. Next iteration, focus will be on new functionality. Hopefully we can fit this in. 

          Show
          jpiironen jpiironen added a comment - Hi, We've resumed development for the plugin and we're currently doing a release for the more urgent bugs. Next iteration, focus will be on new functionality. Hopefully we can fit this in. 

            People

            • Assignee:
              jpiironen jpiironen
              Reporter:
              ozstriker78 Rick Garcia
            • Votes:
              6 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated: