JUnitResultArchiver gets stuck when testDataPublishers are defined in a pipeline

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      When defining a pipeline project and using the following pipeline definition, the jobs gets stuck in "Recording Test Results":

      node {
         stage 'Stage 1'
         echo 'Hello World 1'
         stage 'Stage 2'
         echo 'Hello World 2'
         bat '''echo. > report.xml'''
         
         step([$class: 'JUnitResultArchiver', 
               allowEmptyResults: true, 
               testDataPublishers: [
                   [$class: 'AttachmentPublisher']
               ], 
               testResults: 'report.xml'])
      }
      

      Removing

       [$class: 'AttachmentPublisher']
      

      Makes it work. This is unrelated to the AttachementPublisher plugin - the same happens for any testDataPublishers.

      I have debugged it a bit and it seems the root cause if somehow that an AbstractMethodError is thrown from hudson.tasks.junit.TestDataPublisher when it is run from a pipeline (I guess because the pipeline project does not derive from AbstractBuild but from Run).

      In any case, returning "null" in TestDataPublisher.contributeTestData() instead of throwing an exception at least prevents getting stuck - it of course does not solve the underlying problem.

      Possibly related to JENKINS-28784

            Assignee:
            huybrechts
            Reporter:
            Oliver van Porten
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: