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

JUnitResultArchiver gets stuck when testDataPublishers are defined in a pipeline

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

            huybrechts huybrechts
            mcdeck Oliver van Porten
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: