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)
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?